diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/hso.c | 13 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.c | 25 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 10 |
3 files changed, 20 insertions, 28 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index fe98acaead97..a074c16e2a62 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -936,8 +936,7 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, | |||
936 | if (!odev->rx_buf_missing) { | 936 | if (!odev->rx_buf_missing) { |
937 | /* Packet is complete. Inject into stack. */ | 937 | /* Packet is complete. Inject into stack. */ |
938 | /* We have IP packet here */ | 938 | /* We have IP packet here */ |
939 | odev->skb_rx_buf->protocol = | 939 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); |
940 | __constant_htons(ETH_P_IP); | ||
941 | /* don't check it */ | 940 | /* don't check it */ |
942 | odev->skb_rx_buf->ip_summed = | 941 | odev->skb_rx_buf->ip_summed = |
943 | CHECKSUM_UNNECESSARY; | 942 | CHECKSUM_UNNECESSARY; |
@@ -1247,7 +1246,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) | |||
1247 | * This needs to be a tasklet otherwise we will | 1246 | * This needs to be a tasklet otherwise we will |
1248 | * end up recursively calling this function. | 1247 | * end up recursively calling this function. |
1249 | */ | 1248 | */ |
1250 | void hso_unthrottle_tasklet(struct hso_serial *serial) | 1249 | static void hso_unthrottle_tasklet(struct hso_serial *serial) |
1251 | { | 1250 | { |
1252 | unsigned long flags; | 1251 | unsigned long flags; |
1253 | 1252 | ||
@@ -1266,7 +1265,7 @@ static void hso_unthrottle(struct tty_struct *tty) | |||
1266 | tasklet_hi_schedule(&serial->unthrottle_tasklet); | 1265 | tasklet_hi_schedule(&serial->unthrottle_tasklet); |
1267 | } | 1266 | } |
1268 | 1267 | ||
1269 | void hso_unthrottle_workfunc(struct work_struct *work) | 1268 | static void hso_unthrottle_workfunc(struct work_struct *work) |
1270 | { | 1269 | { |
1271 | struct hso_serial *serial = | 1270 | struct hso_serial *serial = |
1272 | container_of(work, struct hso_serial, | 1271 | container_of(work, struct hso_serial, |
@@ -1465,9 +1464,9 @@ static int hso_serial_chars_in_buffer(struct tty_struct *tty) | |||
1465 | 1464 | ||
1466 | return chars; | 1465 | return chars; |
1467 | } | 1466 | } |
1468 | int tiocmget_submit_urb(struct hso_serial *serial, | 1467 | static int tiocmget_submit_urb(struct hso_serial *serial, |
1469 | struct hso_tiocmget *tiocmget, | 1468 | struct hso_tiocmget *tiocmget, |
1470 | struct usb_device *usb) | 1469 | struct usb_device *usb) |
1471 | { | 1470 | { |
1472 | int result; | 1471 | int result; |
1473 | 1472 | ||
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index bcd858c567e0..b7f763e1298c 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -169,7 +169,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
169 | struct rndis_keepalive_c *msg = (void *)buf; | 169 | struct rndis_keepalive_c *msg = (void *)buf; |
170 | 170 | ||
171 | msg->msg_type = RNDIS_MSG_KEEPALIVE_C; | 171 | msg->msg_type = RNDIS_MSG_KEEPALIVE_C; |
172 | msg->msg_len = ccpu2(sizeof *msg); | 172 | msg->msg_len = cpu_to_le32(sizeof *msg); |
173 | msg->status = RNDIS_STATUS_SUCCESS; | 173 | msg->status = RNDIS_STATUS_SUCCESS; |
174 | retval = usb_control_msg(dev->udev, | 174 | retval = usb_control_msg(dev->udev, |
175 | usb_sndctrlpipe(dev->udev, 0), | 175 | usb_sndctrlpipe(dev->udev, 0), |
@@ -237,7 +237,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, | |||
237 | u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); | 237 | u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); |
238 | u.get->oid = oid; | 238 | u.get->oid = oid; |
239 | u.get->len = cpu_to_le32(in_len); | 239 | u.get->len = cpu_to_le32(in_len); |
240 | u.get->offset = ccpu2(20); | 240 | u.get->offset = cpu_to_le32(20); |
241 | 241 | ||
242 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); | 242 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
243 | if (unlikely(retval < 0)) { | 243 | if (unlikely(retval < 0)) { |
@@ -297,9 +297,9 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
297 | goto fail; | 297 | goto fail; |
298 | 298 | ||
299 | u.init->msg_type = RNDIS_MSG_INIT; | 299 | u.init->msg_type = RNDIS_MSG_INIT; |
300 | u.init->msg_len = ccpu2(sizeof *u.init); | 300 | u.init->msg_len = cpu_to_le32(sizeof *u.init); |
301 | u.init->major_version = ccpu2(1); | 301 | u.init->major_version = cpu_to_le32(1); |
302 | u.init->minor_version = ccpu2(0); | 302 | u.init->minor_version = cpu_to_le32(0); |
303 | 303 | ||
304 | /* max transfer (in spec) is 0x4000 at full speed, but for | 304 | /* max transfer (in spec) is 0x4000 at full speed, but for |
305 | * TX we'll stick to one Ethernet packet plus RNDIS framing. | 305 | * TX we'll stick to one Ethernet packet plus RNDIS framing. |
@@ -403,10 +403,10 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
403 | /* set a nonzero filter to enable data transfers */ | 403 | /* set a nonzero filter to enable data transfers */ |
404 | memset(u.set, 0, sizeof *u.set); | 404 | memset(u.set, 0, sizeof *u.set); |
405 | u.set->msg_type = RNDIS_MSG_SET; | 405 | u.set->msg_type = RNDIS_MSG_SET; |
406 | u.set->msg_len = ccpu2(4 + sizeof *u.set); | 406 | u.set->msg_len = cpu_to_le32(4 + sizeof *u.set); |
407 | u.set->oid = OID_GEN_CURRENT_PACKET_FILTER; | 407 | u.set->oid = OID_GEN_CURRENT_PACKET_FILTER; |
408 | u.set->len = ccpu2(4); | 408 | u.set->len = cpu_to_le32(4); |
409 | u.set->offset = ccpu2((sizeof *u.set) - 8); | 409 | u.set->offset = cpu_to_le32((sizeof *u.set) - 8); |
410 | *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; | 410 | *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; |
411 | 411 | ||
412 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); | 412 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
@@ -423,7 +423,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
423 | halt_fail_and_release: | 423 | halt_fail_and_release: |
424 | memset(u.halt, 0, sizeof *u.halt); | 424 | memset(u.halt, 0, sizeof *u.halt); |
425 | u.halt->msg_type = RNDIS_MSG_HALT; | 425 | u.halt->msg_type = RNDIS_MSG_HALT; |
426 | u.halt->msg_len = ccpu2(sizeof *u.halt); | 426 | u.halt->msg_len = cpu_to_le32(sizeof *u.halt); |
427 | (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); | 427 | (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); |
428 | fail_and_release: | 428 | fail_and_release: |
429 | usb_set_intfdata(info->data, NULL); | 429 | usb_set_intfdata(info->data, NULL); |
@@ -448,7 +448,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
448 | halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); | 448 | halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); |
449 | if (halt) { | 449 | if (halt) { |
450 | halt->msg_type = RNDIS_MSG_HALT; | 450 | halt->msg_type = RNDIS_MSG_HALT; |
451 | halt->msg_len = ccpu2(sizeof *halt); | 451 | halt->msg_len = cpu_to_le32(sizeof *halt); |
452 | (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); | 452 | (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); |
453 | kfree(halt); | 453 | kfree(halt); |
454 | } | 454 | } |
@@ -543,7 +543,7 @@ fill: | |||
543 | memset(hdr, 0, sizeof *hdr); | 543 | memset(hdr, 0, sizeof *hdr); |
544 | hdr->msg_type = RNDIS_MSG_PACKET; | 544 | hdr->msg_type = RNDIS_MSG_PACKET; |
545 | hdr->msg_len = cpu_to_le32(skb->len); | 545 | hdr->msg_len = cpu_to_le32(skb->len); |
546 | hdr->data_offset = ccpu2(sizeof(*hdr) - 8); | 546 | hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8); |
547 | hdr->data_len = cpu_to_le32(len); | 547 | hdr->data_len = cpu_to_le32(len); |
548 | 548 | ||
549 | /* FIXME make the last packet always be short ... */ | 549 | /* FIXME make the last packet always be short ... */ |
@@ -562,9 +562,6 @@ static const struct driver_info rndis_info = { | |||
562 | .tx_fixup = rndis_tx_fixup, | 562 | .tx_fixup = rndis_tx_fixup, |
563 | }; | 563 | }; |
564 | 564 | ||
565 | #undef ccpu2 | ||
566 | |||
567 | |||
568 | /*-------------------------------------------------------------------------*/ | 565 | /*-------------------------------------------------------------------------*/ |
569 | 566 | ||
570 | static const struct usb_device_id products [] = { | 567 | static const struct usb_device_id products [] = { |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 5574abe29c73..3e6155a38f0c 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -55,11 +55,10 @@ struct smsc95xx_priv { | |||
55 | 55 | ||
56 | struct usb_context { | 56 | struct usb_context { |
57 | struct usb_ctrlrequest req; | 57 | struct usb_ctrlrequest req; |
58 | struct completion notify; | ||
59 | struct usbnet *dev; | 58 | struct usbnet *dev; |
60 | }; | 59 | }; |
61 | 60 | ||
62 | int turbo_mode = true; | 61 | static int turbo_mode = true; |
63 | module_param(turbo_mode, bool, 0644); | 62 | module_param(turbo_mode, bool, 0644); |
64 | MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); | 63 | MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); |
65 | 64 | ||
@@ -307,7 +306,7 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
307 | return 0; | 306 | return 0; |
308 | } | 307 | } |
309 | 308 | ||
310 | static void smsc95xx_async_cmd_callback(struct urb *urb, struct pt_regs *regs) | 309 | static void smsc95xx_async_cmd_callback(struct urb *urb) |
311 | { | 310 | { |
312 | struct usb_context *usb_context = urb->context; | 311 | struct usb_context *usb_context = urb->context; |
313 | struct usbnet *dev = usb_context->dev; | 312 | struct usbnet *dev = usb_context->dev; |
@@ -316,8 +315,6 @@ static void smsc95xx_async_cmd_callback(struct urb *urb, struct pt_regs *regs) | |||
316 | if (status < 0) | 315 | if (status < 0) |
317 | devwarn(dev, "async callback failed with %d", status); | 316 | devwarn(dev, "async callback failed with %d", status); |
318 | 317 | ||
319 | complete(&usb_context->notify); | ||
320 | |||
321 | kfree(usb_context); | 318 | kfree(usb_context); |
322 | usb_free_urb(urb); | 319 | usb_free_urb(urb); |
323 | } | 320 | } |
@@ -348,11 +345,10 @@ static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) | |||
348 | usb_context->req.wValue = 00; | 345 | usb_context->req.wValue = 00; |
349 | usb_context->req.wIndex = cpu_to_le16(index); | 346 | usb_context->req.wIndex = cpu_to_le16(index); |
350 | usb_context->req.wLength = cpu_to_le16(size); | 347 | usb_context->req.wLength = cpu_to_le16(size); |
351 | init_completion(&usb_context->notify); | ||
352 | 348 | ||
353 | usb_fill_control_urb(urb, dev->udev, usb_sndctrlpipe(dev->udev, 0), | 349 | usb_fill_control_urb(urb, dev->udev, usb_sndctrlpipe(dev->udev, 0), |
354 | (void *)&usb_context->req, data, size, | 350 | (void *)&usb_context->req, data, size, |
355 | (usb_complete_t)smsc95xx_async_cmd_callback, | 351 | smsc95xx_async_cmd_callback, |
356 | (void *)usb_context); | 352 | (void *)usb_context); |
357 | 353 | ||
358 | status = usb_submit_urb(urb, GFP_ATOMIC); | 354 | status = usb_submit_urb(urb, GFP_ATOMIC); |