diff options
author | Kevin Lloyd <klloyd@sierrawireless.com> | 2008-07-10 17:14:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-13 20:32:51 -0400 |
commit | 4e0fee82619937acb13806ffc901d3920b947286 (patch) | |
tree | ddaba2216df875805b830f641c675837deaf963f /drivers/usb | |
parent | 8c809681ba0289afd0ed7bbb63679a0568dd441d (diff) |
USB Serial Sierra: clean-up
Very minor changes to clean up sierra code. Adds a prefix to debug messages so
that Sierra messages are easily recognized. Removes extraneous code.
This targets kernel 2.6.26-rc9
Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/sierra.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 2f6f1523ec56..a3aaf08e56d5 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -51,7 +51,7 @@ enum devicetype { | |||
51 | static int sierra_set_power_state(struct usb_device *udev, __u16 swiState) | 51 | static int sierra_set_power_state(struct usb_device *udev, __u16 swiState) |
52 | { | 52 | { |
53 | int result; | 53 | int result; |
54 | dev_dbg(&udev->dev, "%s", "SET POWER STATE\n"); | 54 | dev_dbg(&udev->dev, "%s", __func__); |
55 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 55 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
56 | SWIMS_USB_REQUEST_SetPower, /* __u8 request */ | 56 | SWIMS_USB_REQUEST_SetPower, /* __u8 request */ |
57 | USB_TYPE_VENDOR, /* __u8 request type */ | 57 | USB_TYPE_VENDOR, /* __u8 request type */ |
@@ -66,7 +66,7 @@ static int sierra_set_power_state(struct usb_device *udev, __u16 swiState) | |||
66 | static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode) | 66 | static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode) |
67 | { | 67 | { |
68 | int result; | 68 | int result; |
69 | dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH\n"); | 69 | dev_dbg(&udev->dev, "%s", __func__); |
70 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 70 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
71 | SWIMS_USB_REQUEST_SetMode, /* __u8 request */ | 71 | SWIMS_USB_REQUEST_SetMode, /* __u8 request */ |
72 | USB_TYPE_VENDOR, /* __u8 request type */ | 72 | USB_TYPE_VENDOR, /* __u8 request type */ |
@@ -81,7 +81,7 @@ static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode) | |||
81 | static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable) | 81 | static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable) |
82 | { | 82 | { |
83 | int result; | 83 | int result; |
84 | dev_dbg(&udev->dev, "%s", "NMEA Enable sent\n"); | 84 | dev_dbg(&udev->dev, "%s", __func__); |
85 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 85 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
86 | SWIMS_USB_REQUEST_SetNmea, /* __u8 request */ | 86 | SWIMS_USB_REQUEST_SetNmea, /* __u8 request */ |
87 | USB_TYPE_VENDOR, /* __u8 request type */ | 87 | USB_TYPE_VENDOR, /* __u8 request type */ |
@@ -97,6 +97,7 @@ static int sierra_calc_num_ports(struct usb_serial *serial) | |||
97 | { | 97 | { |
98 | int result; | 98 | int result; |
99 | int *num_ports = usb_get_serial_data(serial); | 99 | int *num_ports = usb_get_serial_data(serial); |
100 | dev_dbg(&serial->dev->dev, "%s", __func__); | ||
100 | 101 | ||
101 | result = *num_ports; | 102 | result = *num_ports; |
102 | 103 | ||
@@ -110,22 +111,23 @@ static int sierra_calc_num_ports(struct usb_serial *serial) | |||
110 | 111 | ||
111 | static int sierra_calc_interface(struct usb_serial *serial) | 112 | static int sierra_calc_interface(struct usb_serial *serial) |
112 | { | 113 | { |
113 | int interface; | 114 | int interface; |
114 | struct usb_interface *p_interface; | 115 | struct usb_interface *p_interface; |
115 | struct usb_host_interface *p_host_interface; | 116 | struct usb_host_interface *p_host_interface; |
117 | dev_dbg(&serial->dev->dev, "%s", __func__); | ||
116 | 118 | ||
117 | /* Get the interface structure pointer from the serial struct */ | 119 | /* Get the interface structure pointer from the serial struct */ |
118 | p_interface = serial->interface; | 120 | p_interface = serial->interface; |
119 | 121 | ||
120 | /* Get a pointer to the host interface structure */ | 122 | /* Get a pointer to the host interface structure */ |
121 | p_host_interface = p_interface->cur_altsetting; | 123 | p_host_interface = p_interface->cur_altsetting; |
122 | 124 | ||
123 | /* read the interface descriptor for this active altsetting | 125 | /* read the interface descriptor for this active altsetting |
124 | * to find out the interface number we are on | 126 | * to find out the interface number we are on |
125 | */ | 127 | */ |
126 | interface = p_host_interface->desc.bInterfaceNumber; | 128 | interface = p_host_interface->desc.bInterfaceNumber; |
127 | 129 | ||
128 | return interface; | 130 | return interface; |
129 | } | 131 | } |
130 | 132 | ||
131 | static int sierra_probe(struct usb_serial *serial, | 133 | static int sierra_probe(struct usb_serial *serial, |
@@ -135,6 +137,7 @@ static int sierra_probe(struct usb_serial *serial, | |||
135 | struct usb_device *udev; | 137 | struct usb_device *udev; |
136 | int *num_ports; | 138 | int *num_ports; |
137 | u8 ifnum; | 139 | u8 ifnum; |
140 | dev_dbg(&serial->dev->dev, "%s", __func__); | ||
138 | 141 | ||
139 | num_ports = kmalloc(sizeof(*num_ports), GFP_KERNEL); | 142 | num_ports = kmalloc(sizeof(*num_ports), GFP_KERNEL); |
140 | if (!num_ports) | 143 | if (!num_ports) |
@@ -187,24 +190,26 @@ static struct usb_device_id id_table [] = { | |||
187 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ | 190 | { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ |
188 | { USB_DEVICE(0x0f30, 0x1b1d) }, /* Sierra Wireless MC5720 */ | 191 | { USB_DEVICE(0x0f30, 0x1b1d) }, /* Sierra Wireless MC5720 */ |
189 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ | 192 | { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ |
193 | { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */ | ||
190 | { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */ | 194 | { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */ |
191 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ | 195 | { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ |
192 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 196 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
193 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ | 197 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ |
194 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, /* Sierra Wireless C597 */ | 198 | /* Sierra Wireless C597 */ |
199 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, | ||
195 | 200 | ||
196 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ | 201 | { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ |
197 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ | 202 | { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ |
198 | { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ | 203 | { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ |
199 | { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ | 204 | { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ |
200 | { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */ | 205 | { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Lenovo) */ |
201 | { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ | 206 | { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ |
202 | { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */ | 207 | { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */ |
203 | { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ | 208 | { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ |
204 | { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */ | 209 | { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */ |
205 | { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/ | 210 | { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */ |
206 | { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/ | 211 | { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */ |
207 | { USB_DEVICE(0x1199, 0x683B), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless MC8785 Composite*/ | 212 | { USB_DEVICE(0x1199, 0x683B), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless MC8785 Composite */ |
208 | { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */ | 213 | { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */ |
209 | { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ | 214 | { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ |
210 | { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ | 215 | { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ |
@@ -214,9 +219,6 @@ static struct usb_device_id id_table [] = { | |||
214 | { USB_DEVICE(0x1199, 0x6859), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */ | 219 | { USB_DEVICE(0x1199, 0x6859), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */ |
215 | { USB_DEVICE(0x1199, 0x685A), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */ | 220 | { USB_DEVICE(0x1199, 0x685A), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */ |
216 | 221 | ||
217 | { USB_DEVICE(0x1199, 0x6468) }, /* Sierra Wireless MP3G - EVDO */ | ||
218 | { USB_DEVICE(0x1199, 0x6469) }, /* Sierra Wireless MP3G - UMTS/HSPA */ | ||
219 | |||
220 | { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ | 222 | { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ |
221 | { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ | 223 | { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ |
222 | 224 | ||
@@ -713,7 +715,7 @@ static void sierra_shutdown(struct usb_serial *serial) | |||
713 | static struct usb_serial_driver sierra_device = { | 715 | static struct usb_serial_driver sierra_device = { |
714 | .driver = { | 716 | .driver = { |
715 | .owner = THIS_MODULE, | 717 | .owner = THIS_MODULE, |
716 | .name = "sierra1", | 718 | .name = "sierra", |
717 | }, | 719 | }, |
718 | .description = "Sierra USB modem", | 720 | .description = "Sierra USB modem", |
719 | .id_table = id_table, | 721 | .id_table = id_table, |
@@ -769,14 +771,10 @@ MODULE_DESCRIPTION(DRIVER_DESC); | |||
769 | MODULE_VERSION(DRIVER_VERSION); | 771 | MODULE_VERSION(DRIVER_VERSION); |
770 | MODULE_LICENSE("GPL"); | 772 | MODULE_LICENSE("GPL"); |
771 | 773 | ||
772 | module_param(truinstall, bool, 0); | 774 | module_param(nmea, bool, S_IRUGO | S_IWUSR); |
773 | MODULE_PARM_DESC(truinstall, "TRU-Install support"); | ||
774 | |||
775 | module_param(nmea, bool, 0); | ||
776 | MODULE_PARM_DESC(nmea, "NMEA streaming"); | 775 | MODULE_PARM_DESC(nmea, "NMEA streaming"); |
777 | 776 | ||
778 | #ifdef CONFIG_USB_DEBUG | 777 | #ifdef CONFIG_USB_DEBUG |
779 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 778 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
780 | MODULE_PARM_DESC(debug, "Debug messages"); | 779 | MODULE_PARM_DESC(debug, "Debug messages"); |
781 | #endif | 780 | #endif |
782 | |||