Commit 7e27f18c authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d5681fe8
...@@ -101,9 +101,9 @@ static const char driver_desc [] = DRIVER_DESC; ...@@ -101,9 +101,9 @@ static const char driver_desc [] = DRIVER_DESC;
/* CDC and RNDIS support the same host-chosen outgoing packet filters. */ /* CDC and RNDIS support the same host-chosen outgoing packet filters. */
#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
|USB_CDC_PACKET_TYPE_ALL_MULTICAST \ |USB_CDC_PACKET_TYPE_ALL_MULTICAST \
|USB_CDC_PACKET_TYPE_PROMISCUOUS \ |USB_CDC_PACKET_TYPE_PROMISCUOUS \
|USB_CDC_PACKET_TYPE_DIRECTED) |USB_CDC_PACKET_TYPE_DIRECTED)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -318,7 +318,7 @@ static inline int rndis_active(struct eth_dev *dev) ...@@ -318,7 +318,7 @@ static inline int rndis_active(struct eth_dev *dev)
#define DEFAULT_QLEN 2 /* double buffering by default */ #define DEFAULT_QLEN 2 /* double buffering by default */
/* peak bulk transfer bits-per-second */ /* peak bulk transfer bits-per-second */
#define HS_BPS (13 * 512 * 8 * 1000 * 8) #define HS_BPS (13 * 512 * 8 * 1000 * 8)
#define FS_BPS (19 * 64 * 1 * 1000 * 8) #define FS_BPS (19 * 64 * 1 * 1000 * 8)
#ifdef CONFIG_USB_GADGET_DUALSPEED #ifdef CONFIG_USB_GADGET_DUALSPEED
...@@ -466,7 +466,7 @@ eth_config = { ...@@ -466,7 +466,7 @@ eth_config = {
}; };
#ifdef CONFIG_USB_ETH_RNDIS #ifdef CONFIG_USB_ETH_RNDIS
static struct usb_config_descriptor static struct usb_config_descriptor
rndis_config = { rndis_config = {
.bLength = sizeof rndis_config, .bLength = sizeof rndis_config,
.bDescriptorType = USB_DT_CONFIG, .bDescriptorType = USB_DT_CONFIG,
...@@ -511,7 +511,7 @@ static const struct usb_interface_descriptor ...@@ -511,7 +511,7 @@ static const struct usb_interface_descriptor
rndis_control_intf = { rndis_control_intf = {
.bLength = sizeof rndis_control_intf, .bLength = sizeof rndis_control_intf,
.bDescriptorType = USB_DT_INTERFACE, .bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0, .bInterfaceNumber = 0,
.bNumEndpoints = 1, .bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_COMM, .bInterfaceClass = USB_CLASS_COMM,
...@@ -545,20 +545,20 @@ static const struct usb_cdc_union_desc union_desc = { ...@@ -545,20 +545,20 @@ static const struct usb_cdc_union_desc union_desc = {
#ifdef CONFIG_USB_ETH_RNDIS #ifdef CONFIG_USB_ETH_RNDIS
static const struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = { static const struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = {
.bLength = sizeof call_mgmt_descriptor, .bLength = sizeof call_mgmt_descriptor,
.bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE,
.bmCapabilities = 0x00, .bmCapabilities = 0x00,
.bDataInterface = 0x01, .bDataInterface = 0x01,
}; };
static const struct usb_cdc_acm_descriptor acm_descriptor = { static const struct usb_cdc_acm_descriptor acm_descriptor = {
.bLength = sizeof acm_descriptor, .bLength = sizeof acm_descriptor,
.bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubType = USB_CDC_ACM_TYPE, .bDescriptorSubType = USB_CDC_ACM_TYPE,
.bmCapabilities = 0x00, .bmCapabilities = 0x00,
}; };
#endif #endif
...@@ -595,7 +595,7 @@ static const struct usb_cdc_ether_desc ether_desc = { ...@@ -595,7 +595,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
* RNDIS requires the status endpoint, since it uses that encapsulation * RNDIS requires the status endpoint, since it uses that encapsulation
* mechanism for its funky RPC scheme. * mechanism for its funky RPC scheme.
*/ */
#define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */ #define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */
#define STATUS_BYTECOUNT 16 /* 8 byte header + data */ #define STATUS_BYTECOUNT 16 /* 8 byte header + data */
...@@ -978,7 +978,7 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags) ...@@ -978,7 +978,7 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
result = usb_ep_enable (dev->status_ep, dev->status); result = usb_ep_enable (dev->status_ep, dev->status);
if (result != 0) { if (result != 0) {
DEBUG (dev, "enable %s --> %d\n", DEBUG (dev, "enable %s --> %d\n",
dev->status_ep->name, result); dev->status_ep->name, result);
goto done; goto done;
} }
...@@ -1002,14 +1002,14 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags) ...@@ -1002,14 +1002,14 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)
if (!cdc_active(dev)) { if (!cdc_active(dev)) {
result = usb_ep_enable (dev->in_ep, dev->in); result = usb_ep_enable (dev->in_ep, dev->in);
if (result != 0) { if (result != 0) {
DEBUG(dev, "enable %s --> %d\n", DEBUG(dev, "enable %s --> %d\n",
dev->in_ep->name, result); dev->in_ep->name, result);
goto done; goto done;
} }
result = usb_ep_enable (dev->out_ep, dev->out); result = usb_ep_enable (dev->out_ep, dev->out);
if (result != 0) { if (result != 0) {
DEBUG (dev, "enable %s --> %d\n", DEBUG (dev, "enable %s --> %d\n",
dev->out_ep->name, result); dev->out_ep->name, result);
goto done; goto done;
} }
...@@ -1144,7 +1144,7 @@ eth_set_config (struct eth_dev *dev, unsigned number, gfp_t gfp_flags) ...@@ -1144,7 +1144,7 @@ eth_set_config (struct eth_dev *dev, unsigned number, gfp_t gfp_flags)
#ifdef CONFIG_USB_GADGET_DUALSPEED #ifdef CONFIG_USB_GADGET_DUALSPEED
case USB_SPEED_HIGH: speed = "high"; break; case USB_SPEED_HIGH: speed = "high"; break;
#endif #endif
default: speed = "?"; break; default: speed = "?"; break;
} }
dev->config = number; dev->config = number;
...@@ -1206,7 +1206,7 @@ static void issue_start_status (struct eth_dev *dev) ...@@ -1206,7 +1206,7 @@ static void issue_start_status (struct eth_dev *dev)
struct usb_request *req = dev->stat_req; struct usb_request *req = dev->stat_req;
struct usb_cdc_notification *event; struct usb_cdc_notification *event;
int value; int value;
DEBUG (dev, "%s, flush old status first\n", __FUNCTION__); DEBUG (dev, "%s, flush old status first\n", __FUNCTION__);
/* flush old status /* flush old status
...@@ -1268,7 +1268,7 @@ static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req) ...@@ -1268,7 +1268,7 @@ static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
{ {
struct eth_dev *dev = ep->driver_data; struct eth_dev *dev = ep->driver_data;
int status; int status;
/* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */ /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
spin_lock(&dev->lock); spin_lock(&dev->lock);
status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf); status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf);
...@@ -1472,7 +1472,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) ...@@ -1472,7 +1472,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
#endif /* DEV_CONFIG_CDC */ #endif /* DEV_CONFIG_CDC */
#ifdef CONFIG_USB_ETH_RNDIS #ifdef CONFIG_USB_ETH_RNDIS
/* RNDIS uses the CDC command encapsulation mechanism to implement /* RNDIS uses the CDC command encapsulation mechanism to implement
* an RPC scheme, with much getting/setting of attributes by OID. * an RPC scheme, with much getting/setting of attributes by OID.
*/ */
...@@ -1489,7 +1489,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) ...@@ -1489,7 +1489,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
req->complete = rndis_command_complete; req->complete = rndis_command_complete;
/* later, rndis_control_ack () sends a notification */ /* later, rndis_control_ack () sends a notification */
break; break;
case USB_CDC_GET_ENCAPSULATED_RESPONSE: case USB_CDC_GET_ENCAPSULATED_RESPONSE:
if ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE) if ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_INTERFACE)
== ctrl->bRequestType == ctrl->bRequestType
...@@ -1641,7 +1641,7 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags) ...@@ -1641,7 +1641,7 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
DEBUG (dev, "no rx skb\n"); DEBUG (dev, "no rx skb\n");
goto enomem; goto enomem;
} }
/* Some platforms perform better when IP packets are aligned, /* Some platforms perform better when IP packets are aligned,
* but on at least one, checksumming fails otherwise. Note: * but on at least one, checksumming fails otherwise. Note:
* RNDIS headers involve variable numbers of LE32 values. * RNDIS headers involve variable numbers of LE32 values.
...@@ -1720,7 +1720,7 @@ static void rx_complete (struct usb_ep *ep, struct usb_request *req) ...@@ -1720,7 +1720,7 @@ static void rx_complete (struct usb_ep *ep, struct usb_request *req)
case -EOVERFLOW: case -EOVERFLOW:
dev->stats.rx_over_errors++; dev->stats.rx_over_errors++;
// FALLTHROUGH // FALLTHROUGH
default: default:
dev->stats.rx_errors++; dev->stats.rx_errors++;
DEBUG (dev, "rx status %d\n", status); 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,7 +1915,7 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
sizeof (struct rndis_packet_msg_type)); sizeof (struct rndis_packet_msg_type));
if (!skb_rndis) if (!skb_rndis)
goto drop; goto drop;
dev_kfree_skb_any (skb); dev_kfree_skb_any (skb);
skb = skb_rndis; skb = skb_rndis;
rndis_add_hdr (skb); rndis_add_hdr (skb);
...@@ -2001,7 +2001,7 @@ static int rndis_control_ack (struct net_device *net) ...@@ -2001,7 +2001,7 @@ static int rndis_control_ack (struct net_device *net)
struct eth_dev *dev = netdev_priv(net); struct eth_dev *dev = netdev_priv(net);
u32 length; u32 length;
struct usb_request *resp = dev->stat_req; struct usb_request *resp = dev->stat_req;
/* in case RNDIS calls this after disconnect */ /* in case RNDIS calls this after disconnect */
if (!dev->status) { if (!dev->status) {
DEBUG (dev, "status ENODEV\n"); DEBUG (dev, "status ENODEV\n");
...@@ -2021,16 +2021,16 @@ static int rndis_control_ack (struct net_device *net) ...@@ -2021,16 +2021,16 @@ static int rndis_control_ack (struct net_device *net)
resp->length = 8; resp->length = 8;
resp->complete = rndis_control_ack_complete; resp->complete = rndis_control_ack_complete;
resp->context = dev; resp->context = dev;
*((__le32 *) resp->buf) = __constant_cpu_to_le32 (1); *((__le32 *) resp->buf) = __constant_cpu_to_le32 (1);
*((__le32 *) resp->buf + 1) = __constant_cpu_to_le32 (0); *((__le32 *) resp->buf + 1) = __constant_cpu_to_le32 (0);
length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC); length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC);
if (length < 0) { if (length < 0) {
resp->status = 0; resp->status = 0;
rndis_control_ack_complete (dev->status_ep, resp); rndis_control_ack_complete (dev->status_ep, resp);
} }
return 0; return 0;
} }
...@@ -2047,7 +2047,7 @@ static void eth_start (struct eth_dev *dev, gfp_t gfp_flags) ...@@ -2047,7 +2047,7 @@ static void eth_start (struct eth_dev *dev, gfp_t gfp_flags)
/* fill the rx queue */ /* fill the rx queue */
rx_fill (dev, gfp_flags); rx_fill (dev, gfp_flags);
/* and open the tx floodgates */ /* and open the tx floodgates */
atomic_set (&dev->tx_qlen, 0); atomic_set (&dev->tx_qlen, 0);
netif_wake_queue (dev->net); netif_wake_queue (dev->net);
if (rndis_active(dev)) { if (rndis_active(dev)) {
...@@ -2076,7 +2076,7 @@ static int eth_stop (struct net_device *net) ...@@ -2076,7 +2076,7 @@ static int eth_stop (struct net_device *net)
netif_stop_queue (net); netif_stop_queue (net);
DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
dev->stats.rx_packets, dev->stats.tx_packets, dev->stats.rx_packets, dev->stats.tx_packets,
dev->stats.rx_errors, dev->stats.tx_errors dev->stats.rx_errors, dev->stats.tx_errors
); );
...@@ -2095,7 +2095,7 @@ static int eth_stop (struct net_device *net) ...@@ -2095,7 +2095,7 @@ static int eth_stop (struct net_device *net)
usb_ep_enable (dev->status_ep, dev->status); usb_ep_enable (dev->status_ep, dev->status);
} }
} }
if (rndis_active(dev)) { if (rndis_active(dev)) {
rndis_set_param_medium (dev->rndis_config, rndis_set_param_medium (dev->rndis_config,
NDIS_MEDIUM_802_3, 0); NDIS_MEDIUM_802_3, 0);
...@@ -2301,7 +2301,7 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2301,7 +2301,7 @@ eth_bind (struct usb_gadget *gadget)
return -ENODEV; return -ENODEV;
} }
in_ep->driver_data = in_ep; /* claim */ in_ep->driver_data = in_ep; /* claim */
out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc); out_ep = usb_ep_autoconfig (gadget, &fs_sink_desc);
if (!out_ep) if (!out_ep)
goto autoconf_fail; goto autoconf_fail;
...@@ -2374,8 +2374,8 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2374,8 +2374,8 @@ eth_bind (struct usb_gadget *gadget)
#endif #endif
} }
net = alloc_etherdev (sizeof *dev); net = alloc_etherdev (sizeof *dev);
if (!net) if (!net)
return status; return status;
dev = netdev_priv(net); dev = netdev_priv(net);
spin_lock_init (&dev->lock); spin_lock_init (&dev->lock);
...@@ -2454,7 +2454,7 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2454,7 +2454,7 @@ eth_bind (struct usb_gadget *gadget)
dev->gadget = gadget; dev->gadget = gadget;
set_gadget_data (gadget, dev); set_gadget_data (gadget, dev);
gadget->ep0->driver_data = dev; gadget->ep0->driver_data = dev;
/* two kinds of host-initiated state changes: /* two kinds of host-initiated state changes:
* - iff DATA transfer is active, carrier is "on" * - iff DATA transfer is active, carrier is "on"
* - tx queueing enabled if open *and* carrier is "on" * - tx queueing enabled if open *and* carrier is "on"
...@@ -2462,8 +2462,8 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2462,8 +2462,8 @@ eth_bind (struct usb_gadget *gadget)
netif_stop_queue (dev->net); netif_stop_queue (dev->net);
netif_carrier_off (dev->net); netif_carrier_off (dev->net);
SET_NETDEV_DEV (dev->net, &gadget->dev); SET_NETDEV_DEV (dev->net, &gadget->dev);
status = register_netdev (dev->net); status = register_netdev (dev->net);
if (status < 0) if (status < 0)
goto fail1; goto fail1;
...@@ -2488,7 +2488,7 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2488,7 +2488,7 @@ eth_bind (struct usb_gadget *gadget)
u32 vendorID = 0; u32 vendorID = 0;
/* FIXME RNDIS vendor id == "vendor NIC code" == ? */ /* FIXME RNDIS vendor id == "vendor NIC code" == ? */
dev->rndis_config = rndis_register (rndis_control_ack); dev->rndis_config = rndis_register (rndis_control_ack);
if (dev->rndis_config < 0) { if (dev->rndis_config < 0) {
fail0: fail0:
...@@ -2496,7 +2496,7 @@ eth_bind (struct usb_gadget *gadget) ...@@ -2496,7 +2496,7 @@ eth_bind (struct usb_gadget *gadget)
status = -ENODEV; status = -ENODEV;
goto fail; goto fail;
} }
/* these set up a lot of the OIDs that RNDIS needs */ /* these set up a lot of the OIDs that RNDIS needs */
rndis_set_host_mac (dev->rndis_config, dev->host_mac); rndis_set_host_mac (dev->rndis_config, dev->host_mac);
if (rndis_set_param_dev (dev->rndis_config, dev->net, if (rndis_set_param_dev (dev->rndis_config, dev->net,
...@@ -2556,7 +2556,7 @@ static struct usb_gadget_driver eth_driver = { ...@@ -2556,7 +2556,7 @@ static struct usb_gadget_driver eth_driver = {
.suspend = eth_suspend, .suspend = eth_suspend,
.resume = eth_resume, .resume = eth_resume,
.driver = { .driver = {
.name = (char *) shortname, .name = (char *) shortname,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
......
This diff is collapsed.
/* /*
* RNDIS Definitions for Remote NDIS * RNDIS Definitions for Remote NDIS
* *
* Version: $Id: rndis.h,v 1.15 2004/03/25 21:33:46 robert Exp $ * Version: $Id: rndis.h,v 1.15 2004/03/25 21:33:46 robert Exp $
* *
* Authors: Benedikt Spranger, Pengutronix * Authors: Benedikt Spranger, Pengutronix
* Robert Schwebel, Pengutronix * Robert Schwebel, Pengutronix
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* version 2, as published by the Free Software Foundation. * version 2, as published by the Free Software Foundation.
* *
* This software was originally developed in conformance with * This software was originally developed in conformance with
* Microsoft's Remote NDIS Specification License Agreement. * Microsoft's Remote NDIS Specification License Agreement.
*/ */
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BU /* Device connected */ #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BU /* Device connected */
#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CU /* Device disconnected */ #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CU /* Device disconnected */
/* For all not specified status messages: /* For all not specified status messages:
* RNDIS_STATUS_Xxx -> NDIS_STATUS_Xxx * RNDIS_STATUS_Xxx -> NDIS_STATUS_Xxx
*/ */
/* Message Set for Connectionless (802.3) Devices */ /* Message Set for Connectionless (802.3) Devices */
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#define OID_PNP_ENABLE_WAKE_UP 0xFD010106 #define OID_PNP_ENABLE_WAKE_UP 0xFD010106
typedef struct rndis_init_msg_type typedef struct rndis_init_msg_type
{ {
__le32 MessageType; __le32 MessageType;
__le32 MessageLength; __le32 MessageLength;
...@@ -234,12 +234,12 @@ typedef struct rndis_params ...@@ -234,12 +234,12 @@ typedef struct rndis_params
const u8 *host_mac; const u8 *host_mac;
u16 *filter; u16 *filter;
struct net_device *dev; struct net_device *dev;
struct net_device_stats *stats; struct net_device_stats *stats;
u32 vendorID; u32 vendorID;
const char *vendorDescr; const char *vendorDescr;
int (*ack) (struct net_device *); int (*ack) (struct net_device *);
struct list_head resp_queue; struct list_head resp_queue;
} rndis_params; } rndis_params;
...@@ -250,7 +250,7 @@ void rndis_deregister (int configNr); ...@@ -250,7 +250,7 @@ void rndis_deregister (int configNr);
int rndis_set_param_dev (u8 configNr, struct net_device *dev, int rndis_set_param_dev (u8 configNr, struct net_device *dev,
struct net_device_stats *stats, struct net_device_stats *stats,
u16 *cdc_filter); u16 *cdc_filter);
int rndis_set_param_vendor (u8 configNr, u32 vendorID, int rndis_set_param_vendor (u8 configNr, u32 vendorID,
const char *vendorDescr); const char *vendorDescr);
int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed); int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed);
void rndis_add_hdr (struct sk_buff *skb); void rndis_add_hdr (struct sk_buff *skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment