aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-06-13 12:54:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 18:04:18 -0400
commit7e27f18c8a37ffb95f677e4e9c3cca818a3e9eb1 (patch)
tree24bbec7b9e3bd8e2642471e9ee9bd1e45c992e71 /drivers/usb/gadget/ether.c
parentd5681fe8110e1169902df37a8fd8bd01c2b7810e (diff)
[PATCH] USB: whitespace removal from usb/gadget/ether
This removes extraneous whitespace from the Ethernet/RNDIS gadget driver. It's all space-at-EOL, spaces-before-tabs, or tabs-then-spaces. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index bd60c816e907..fc4684096fcc 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -101,9 +101,9 @@ static const char driver_desc [] = DRIVER_DESC;
101 101
102/* CDC and RNDIS support the same host-chosen outgoing packet filters. */ 102/* CDC and RNDIS support the same host-chosen outgoing packet filters. */
103#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ 103#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
104 |USB_CDC_PACKET_TYPE_ALL_MULTICAST \ 104 |USB_CDC_PACKET_TYPE_ALL_MULTICAST \
105 |USB_CDC_PACKET_TYPE_PROMISCUOUS \ 105 |USB_CDC_PACKET_TYPE_PROMISCUOUS \
106 |USB_CDC_PACKET_TYPE_DIRECTED) 106 |USB_CDC_PACKET_TYPE_DIRECTED)
107 107
108 108
109/*-------------------------------------------------------------------------*/ 109/*-------------------------------------------------------------------------*/
@@ -318,7 +318,7 @@ static inline int rndis_active(struct eth_dev *dev)
318#define DEFAULT_QLEN 2 /* double buffering by default */ 318#define DEFAULT_QLEN 2 /* double buffering by default */
319 319
320/* peak bulk transfer bits-per-second */ 320/* peak bulk transfer bits-per-second */
321#define HS_BPS (13 * 512 * 8 * 1000 * 8) 321#define HS_BPS (13 * 512 * 8 * 1000 * 8)
322#define FS_BPS (19 * 64 * 1 * 1000 * 8) 322#define FS_BPS (19 * 64 * 1 * 1000 * 8)
323 323
324#ifdef CONFIG_USB_GADGET_DUALSPEED 324#ifdef CONFIG_USB_GADGET_DUALSPEED
@@ -466,7 +466,7 @@ eth_config = {
466}; 466};
467 467
468#ifdef CONFIG_USB_ETH_RNDIS 468#ifdef CONFIG_USB_ETH_RNDIS
469static struct usb_config_descriptor 469static struct usb_config_descriptor
470rndis_config = { 470rndis_config = {
471 .bLength = sizeof rndis_config, 471 .bLength = sizeof rndis_config,
472 .bDescriptorType = USB_DT_CONFIG, 472 .bDescriptorType = USB_DT_CONFIG,
@@ -511,7 +511,7 @@ static const struct usb_interface_descriptor
511rndis_control_intf = { 511rndis_control_intf = {
512 .bLength = sizeof rndis_control_intf, 512 .bLength = sizeof rndis_control_intf,
513 .bDescriptorType = USB_DT_INTERFACE, 513 .bDescriptorType = USB_DT_INTERFACE,
514 514
515 .bInterfaceNumber = 0, 515 .bInterfaceNumber = 0,
516 .bNumEndpoints = 1, 516 .bNumEndpoints = 1,
517 .bInterfaceClass = USB_CLASS_COMM, 517 .bInterfaceClass = USB_CLASS_COMM,
@@ -545,20 +545,20 @@ static const struct usb_cdc_union_desc union_desc = {
545#ifdef CONFIG_USB_ETH_RNDIS 545#ifdef CONFIG_USB_ETH_RNDIS
546 546
547static const struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = { 547static const struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = {
548 .bLength = sizeof call_mgmt_descriptor, 548 .bLength = sizeof call_mgmt_descriptor,
549 .bDescriptorType = USB_DT_CS_INTERFACE, 549 .bDescriptorType = USB_DT_CS_INTERFACE,
550 .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, 550 .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE,
551 551
552 .bmCapabilities = 0x00, 552 .bmCapabilities = 0x00,
553 .bDataInterface = 0x01, 553 .bDataInterface = 0x01,
554}; 554};
555 555
556static const struct usb_cdc_acm_descriptor acm_descriptor = { 556static const struct usb_cdc_acm_descriptor acm_descriptor = {
557 .bLength = sizeof acm_descriptor, 557 .bLength = sizeof acm_descriptor,
558 .bDescriptorType = USB_DT_CS_INTERFACE, 558 .bDescriptorType = USB_DT_CS_INTERFACE,
559 .bDescriptorSubType = USB_CDC_ACM_TYPE, 559 .bDescriptorSubType = USB_CDC_ACM_TYPE,
560 560
561 .bmCapabilities = 0x00, 561 .bmCapabilities = 0x00,
562}; 562};
563 563
564#endif 564#endif
@@ -595,7 +595,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
595 * RNDIS requires the status endpoint, since it uses that encapsulation 595 * RNDIS requires the status endpoint, since it uses that encapsulation
596 * mechanism for its funky RPC scheme. 596 * mechanism for its funky RPC scheme.
597 */ 597 */
598 598
599#define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */ 599#define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */
600#define STATUS_BYTECOUNT 16 /* 8 byte header + data */ 600#define STATUS_BYTECOUNT 16 /* 8 byte header + data */
601 601
@@ -978,7 +978,7 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
978 978
979 result = usb_ep_enable (dev->status_ep, dev->status); 979 result = usb_ep_enable (dev->status_ep, dev->status);
980 if (result != 0) { 980 if (result != 0) {
981 DEBUG (dev, "enable %s --> %d\n", 981 DEBUG (dev, "enable %s --> %d\n",
982 dev->status_ep->name, result); 982 dev->status_ep->name, result);
983 goto done; 983 goto done;
984 } 984 }
@@ -1002,14 +1002,14 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
1002 if (!cdc_active(dev)) { 1002 if (!cdc_active(dev)) {
1003 result = usb_ep_enable (dev->in_ep, dev->in); 1003 result = usb_ep_enable (dev->in_ep, dev->in);
1004 if (result != 0) { 1004 if (result != 0) {
1005 DEBUG(dev, "enable %s --> %d\n", 1005 DEBUG(dev, "enable %s --> %d\n",
1006 dev->in_ep->name, result); 1006 dev->in_ep->name, result);
1007 goto done; 1007 goto done;
1008 } 1008 }
1009 1009
1010 result = usb_ep_enable (dev->out_ep, dev->out); 1010 result = usb_ep_enable (dev->out_ep, dev->out);
1011 if (result != 0) { 1011 if (result != 0) {
1012 DEBUG (dev, "enable %s --> %d\n", 1012 DEBUG (dev, "enable %s --> %d\n",
1013 dev->out_ep->name, result); 1013 dev->out_ep->name, result);
1014 goto done; 1014 goto done;
1015 } 1015 }
@@ -1144,7 +1144,7 @@ eth_set_config (struct eth_dev *dev, unsigned number, gfp_t gfp_flags)
1144#ifdef CONFIG_USB_GADGET_DUALSPEED 1144#ifdef CONFIG_USB_GADGET_DUALSPEED
1145 case USB_SPEED_HIGH: speed = "high"; break; 1145 case USB_SPEED_HIGH: speed = "high"; break;
1146#endif 1146#endif
1147 default: speed = "?"; break; 1147 default: speed = "?"; break;
1148 } 1148 }
1149 1149
1150 dev->config = number; 1150 dev->config = number;
@@ -1206,7 +1206,7 @@ static void issue_start_status (struct eth_dev *dev)
1206 struct usb_request *req = dev->stat_req; 1206 struct usb_request *req = dev->stat_req;
1207 struct usb_cdc_notification *event; 1207 struct usb_cdc_notification *event;
1208 int value; 1208 int value;
1209 1209
1210 DEBUG (dev, "%s, flush old status first\n", __FUNCTION__); 1210 DEBUG (dev, "%s, flush old status first\n", __FUNCTION__);
1211 1211
1212 /* flush old status 1212 /* flush old status
@@ -1268,7 +1268,7 @@ static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
1268{ 1268{
1269 struct eth_dev *dev = ep->driver_data; 1269 struct eth_dev *dev = ep->driver_data;
1270 int status; 1270 int status;
1271 1271
1272 /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */ 1272 /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
1273 spin_lock(&dev->lock); 1273 spin_lock(&dev->lock);
1274 status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf); 1274 status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf);
@@ -1472,7 +1472,7 @@ done_set_intf:
1472 1472
1473#endif /* DEV_CONFIG_CDC */ 1473#endif /* DEV_CONFIG_CDC */
1474 1474
1475#ifdef CONFIG_USB_ETH_RNDIS 1475#ifdef CONFIG_USB_ETH_RNDIS
1476 /* RNDIS uses the CDC command encapsulation mechanism to implement 1476 /* RNDIS uses the CDC command encapsulation mechanism to implement
1477 * an RPC scheme, with much getting/setting of attributes by OID. 1477 * an RPC scheme, with much getting/setting of attributes by OID.
1478 */ 1478 */
@@ -1489,7 +1489,7 @@ done_set_intf:
1489 req->complete = rndis_command_complete; 1489 req->complete = rndis_command_complete;
1490 /* later, rndis_control_ack () sends a notification */ 1490 /* later, rndis_control_ack () sends a notification */
1491 break; 1491 break;
1492 1492
1493 case USB_CDC_GET_ENCAPSULATED_RESPONSE: 1493 case USB_CDC_GET_ENCAPSULATED_RESPONSE:
1494 if ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE) 1494 if ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE)
1495 == ctrl->bRequestType 1495 == ctrl->bRequestType
@@ -1641,7 +1641,7 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
1641 DEBUG (dev, "no rx skb\n"); 1641 DEBUG (dev, "no rx skb\n");
1642 goto enomem; 1642 goto enomem;
1643 } 1643 }
1644 1644
1645 /* Some platforms perform better when IP packets are aligned, 1645 /* Some platforms perform better when IP packets are aligned,
1646 * but on at least one, checksumming fails otherwise. Note: 1646 * but on at least one, checksumming fails otherwise. Note:
1647 * RNDIS headers involve variable numbers of LE32 values. 1647 * RNDIS headers involve variable numbers of LE32 values.
@@ -1720,7 +1720,7 @@ quiesce:
1720 case -EOVERFLOW: 1720 case -EOVERFLOW:
1721 dev->stats.rx_over_errors++; 1721 dev->stats.rx_over_errors++;
1722 // FALLTHROUGH 1722 // FALLTHROUGH
1723 1723
1724 default: 1724 default:
1725 dev->stats.rx_errors++; 1725 dev->stats.rx_errors++;
1726 DEBUG (dev, "rx status %d\n", status); 1726 DEBUG (dev, "rx status %d\n", status);
@@ -1915,7 +1915,7 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
1915 sizeof (struct rndis_packet_msg_type)); 1915 sizeof (struct rndis_packet_msg_type));
1916 if (!skb_rndis) 1916 if (!skb_rndis)
1917 goto drop; 1917 goto drop;
1918 1918
1919 dev_kfree_skb_any (skb); 1919 dev_kfree_skb_any (skb);
1920 skb = skb_rndis; 1920 skb = skb_rndis;
1921 rndis_add_hdr (skb); 1921 rndis_add_hdr (skb);
@@ -2001,7 +2001,7 @@ static int rndis_control_ack (struct net_device *net)
2001 struct eth_dev *dev = netdev_priv(net); 2001 struct eth_dev *dev = netdev_priv(net);
2002 u32 length; 2002 u32 length;
2003 struct usb_request *resp = dev->stat_req; 2003 struct usb_request *resp = dev->stat_req;
2004 2004
2005 /* in case RNDIS calls this after disconnect */ 2005 /* in case RNDIS calls this after disconnect */
2006 if (!dev->status) { 2006 if (!dev->status) {
2007 DEBUG (dev, "status ENODEV\n"); 2007 DEBUG (dev, "status ENODEV\n");
@@ -2021,16 +2021,16 @@ static int rndis_control_ack (struct net_device *net)
2021 resp->length = 8; 2021 resp->length = 8;
2022 resp->complete = rndis_control_ack_complete; 2022 resp->complete = rndis_control_ack_complete;
2023 resp->context = dev; 2023 resp->context = dev;
2024 2024
2025 *((__le32 *) resp->buf) = __constant_cpu_to_le32 (1); 2025 *((__le32 *) resp->buf) = __constant_cpu_to_le32 (1);
2026 *((__le32 *) resp->buf + 1) = __constant_cpu_to_le32 (0); 2026 *((__le32 *) resp->buf + 1) = __constant_cpu_to_le32 (0);
2027 2027
2028 length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC); 2028 length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC);
2029 if (length < 0) { 2029 if (length < 0) {
2030 resp->status = 0; 2030 resp->status = 0;
2031 rndis_control_ack_complete (dev->status_ep, resp); 2031 rndis_control_ack_complete (dev->status_ep, resp);
2032 } 2032 }
2033 2033
2034 return 0; 2034 return 0;
2035} 2035}
2036 2036
@@ -2047,7 +2047,7 @@ static void eth_start (struct eth_dev *dev, gfp_t gfp_flags)
2047 /* fill the rx queue */ 2047 /* fill the rx queue */
2048 rx_fill (dev, gfp_flags); 2048 rx_fill (dev, gfp_flags);
2049 2049
2050 /* and open the tx floodgates */ 2050 /* and open the tx floodgates */
2051 atomic_set (&dev->tx_qlen, 0); 2051 atomic_set (&dev->tx_qlen, 0);
2052 netif_wake_queue (dev->net); 2052 netif_wake_queue (dev->net);
2053 if (rndis_active(dev)) { 2053 if (rndis_active(dev)) {
@@ -2076,7 +2076,7 @@ static int eth_stop (struct net_device *net)
2076 netif_stop_queue (net); 2076 netif_stop_queue (net);
2077 2077
2078 DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", 2078 DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
2079 dev->stats.rx_packets, dev->stats.tx_packets, 2079 dev->stats.rx_packets, dev->stats.tx_packets,
2080 dev->stats.rx_errors, dev->stats.tx_errors 2080 dev->stats.rx_errors, dev->stats.tx_errors
2081 ); 2081 );
2082 2082
@@ -2095,7 +2095,7 @@ static int eth_stop (struct net_device *net)
2095 usb_ep_enable (dev->status_ep, dev->status); 2095 usb_ep_enable (dev->status_ep, dev->status);
2096 } 2096 }
2097 } 2097 }
2098 2098
2099 if (rndis_active(dev)) { 2099 if (rndis_active(dev)) {
2100 rndis_set_param_medium (dev->rndis_config, 2100 rndis_set_param_medium (dev->rndis_config,
2101 NDIS_MEDIUM_802_3, 0); 2101 NDIS_MEDIUM_802_3, 0);
@@ -2301,7 +2301,7 @@ autoconf_fail:
2301 return -ENODEV; 2301 return -ENODEV;
2302 } 2302 }
2303 in_ep->driver_data = in_ep; /* claim */ 2303 in_ep->driver_data = in_ep; /* claim */
2304 2304
2305 out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc); 2305 out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
2306 if (!out_ep) 2306 if (!out_ep)
2307 goto autoconf_fail; 2307 goto autoconf_fail;
@@ -2374,8 +2374,8 @@ autoconf_fail:
2374#endif 2374#endif
2375 } 2375 }
2376 2376
2377 net = alloc_etherdev (sizeof *dev); 2377 net = alloc_etherdev (sizeof *dev);
2378 if (!net) 2378 if (!net)
2379 return status; 2379 return status;
2380 dev = netdev_priv(net); 2380 dev = netdev_priv(net);
2381 spin_lock_init (&dev->lock); 2381 spin_lock_init (&dev->lock);
@@ -2454,7 +2454,7 @@ autoconf_fail:
2454 dev->gadget = gadget; 2454 dev->gadget = gadget;
2455 set_gadget_data (gadget, dev); 2455 set_gadget_data (gadget, dev);
2456 gadget->ep0->driver_data = dev; 2456 gadget->ep0->driver_data = dev;
2457 2457
2458 /* two kinds of host-initiated state changes: 2458 /* two kinds of host-initiated state changes:
2459 * - iff DATA transfer is active, carrier is "on" 2459 * - iff DATA transfer is active, carrier is "on"
2460 * - tx queueing enabled if open *and* carrier is "on" 2460 * - tx queueing enabled if open *and* carrier is "on"
@@ -2462,8 +2462,8 @@ autoconf_fail:
2462 netif_stop_queue (dev->net); 2462 netif_stop_queue (dev->net);
2463 netif_carrier_off (dev->net); 2463 netif_carrier_off (dev->net);
2464 2464
2465 SET_NETDEV_DEV (dev->net, &gadget->dev); 2465 SET_NETDEV_DEV (dev->net, &gadget->dev);
2466 status = register_netdev (dev->net); 2466 status = register_netdev (dev->net);
2467 if (status < 0) 2467 if (status < 0)
2468 goto fail1; 2468 goto fail1;
2469 2469
@@ -2488,7 +2488,7 @@ autoconf_fail:
2488 u32 vendorID = 0; 2488 u32 vendorID = 0;
2489 2489
2490 /* FIXME RNDIS vendor id == "vendor NIC code" == ? */ 2490 /* FIXME RNDIS vendor id == "vendor NIC code" == ? */
2491 2491
2492 dev->rndis_config = rndis_register (rndis_control_ack); 2492 dev->rndis_config = rndis_register (rndis_control_ack);
2493 if (dev->rndis_config < 0) { 2493 if (dev->rndis_config < 0) {
2494fail0: 2494fail0:
@@ -2496,7 +2496,7 @@ fail0:
2496 status = -ENODEV; 2496 status = -ENODEV;
2497 goto fail; 2497 goto fail;
2498 } 2498 }
2499 2499
2500 /* these set up a lot of the OIDs that RNDIS needs */ 2500 /* these set up a lot of the OIDs that RNDIS needs */
2501 rndis_set_host_mac (dev->rndis_config, dev->host_mac); 2501 rndis_set_host_mac (dev->rndis_config, dev->host_mac);
2502 if (rndis_set_param_dev (dev->rndis_config, dev->net, 2502 if (rndis_set_param_dev (dev->rndis_config, dev->net,
@@ -2556,7 +2556,7 @@ static struct usb_gadget_driver eth_driver = {
2556 .suspend = eth_suspend, 2556 .suspend = eth_suspend,
2557 .resume = eth_resume, 2557 .resume = eth_resume,
2558 2558
2559 .driver = { 2559 .driver = {
2560 .name = (char *) shortname, 2560 .name = (char *) shortname,
2561 .owner = THIS_MODULE, 2561 .owner = THIS_MODULE,
2562 }, 2562 },