aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/rndis.h
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2005-04-28 16:45:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:50 -0400
commit340600ab4cf0cc41efd01a65af97ebb7d35a7f85 (patch)
tree4834521d8ccf7e7b63bbc8500fbe5323ee174b3b /drivers/usb/gadget/rndis.h
parent247f3105636caa9d1d8a4c3dfb755de42633bc80 (diff)
[PATCH] USB: rndis updates (mostly cleanup)
Some bugfixes and lots of cleanup (net code shrink): - On reset, force the RNDIS state machine its initial state - Hook up the RNDIS (outgoing) filters to the CDC mechanism - Lots of cleanup: * Eliminate duplicate copy of OID table; * Unify handlying of the OID "query" response data pointer; * Reduce code duplication for calculating query response lengths; * Remove some checks for "can't happen" errors; * Get rid of debugging #ifdefs by making the debug flag an integer level Most of the patch, by volume, relates to those query response cleanups. It incidentally shaves off a few hundred bytes of object code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/rndis.h')
-rw-r--r--drivers/usb/gadget/rndis.h95
1 files changed, 8 insertions, 87 deletions
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h
index 2b5b55df3cfd..95b4c6326100 100644
--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -69,90 +69,6 @@
69#define OID_PNP_ENABLE_WAKE_UP 0xFD010106 69#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
70 70
71 71
72/* supported OIDs */
73static const u32 oid_supported_list [] =
74{
75 /* the general stuff */
76 OID_GEN_SUPPORTED_LIST,
77 OID_GEN_HARDWARE_STATUS,
78 OID_GEN_MEDIA_SUPPORTED,
79 OID_GEN_MEDIA_IN_USE,
80 OID_GEN_MAXIMUM_FRAME_SIZE,
81 OID_GEN_LINK_SPEED,
82 OID_GEN_TRANSMIT_BLOCK_SIZE,
83 OID_GEN_RECEIVE_BLOCK_SIZE,
84 OID_GEN_VENDOR_ID,
85 OID_GEN_VENDOR_DESCRIPTION,
86 OID_GEN_VENDOR_DRIVER_VERSION,
87 OID_GEN_CURRENT_PACKET_FILTER,
88 OID_GEN_MAXIMUM_TOTAL_SIZE,
89 OID_GEN_MEDIA_CONNECT_STATUS,
90 OID_GEN_PHYSICAL_MEDIUM,
91#if 0
92 OID_GEN_RNDIS_CONFIG_PARAMETER,
93#endif
94
95 /* the statistical stuff */
96 OID_GEN_XMIT_OK,
97 OID_GEN_RCV_OK,
98 OID_GEN_XMIT_ERROR,
99 OID_GEN_RCV_ERROR,
100 OID_GEN_RCV_NO_BUFFER,
101#ifdef RNDIS_OPTIONAL_STATS
102 OID_GEN_DIRECTED_BYTES_XMIT,
103 OID_GEN_DIRECTED_FRAMES_XMIT,
104 OID_GEN_MULTICAST_BYTES_XMIT,
105 OID_GEN_MULTICAST_FRAMES_XMIT,
106 OID_GEN_BROADCAST_BYTES_XMIT,
107 OID_GEN_BROADCAST_FRAMES_XMIT,
108 OID_GEN_DIRECTED_BYTES_RCV,
109 OID_GEN_DIRECTED_FRAMES_RCV,
110 OID_GEN_MULTICAST_BYTES_RCV,
111 OID_GEN_MULTICAST_FRAMES_RCV,
112 OID_GEN_BROADCAST_BYTES_RCV,
113 OID_GEN_BROADCAST_FRAMES_RCV,
114 OID_GEN_RCV_CRC_ERROR,
115 OID_GEN_TRANSMIT_QUEUE_LENGTH,
116#endif /* RNDIS_OPTIONAL_STATS */
117
118 /* mandatory 802.3 */
119 /* the general stuff */
120 OID_802_3_PERMANENT_ADDRESS,
121 OID_802_3_CURRENT_ADDRESS,
122 OID_802_3_MULTICAST_LIST,
123 OID_802_3_MAC_OPTIONS,
124 OID_802_3_MAXIMUM_LIST_SIZE,
125
126 /* the statistical stuff */
127 OID_802_3_RCV_ERROR_ALIGNMENT,
128 OID_802_3_XMIT_ONE_COLLISION,
129 OID_802_3_XMIT_MORE_COLLISIONS,
130#ifdef RNDIS_OPTIONAL_STATS
131 OID_802_3_XMIT_DEFERRED,
132 OID_802_3_XMIT_MAX_COLLISIONS,
133 OID_802_3_RCV_OVERRUN,
134 OID_802_3_XMIT_UNDERRUN,
135 OID_802_3_XMIT_HEARTBEAT_FAILURE,
136 OID_802_3_XMIT_TIMES_CRS_LOST,
137 OID_802_3_XMIT_LATE_COLLISIONS,
138#endif /* RNDIS_OPTIONAL_STATS */
139
140#ifdef RNDIS_PM
141 /* PM and wakeup are mandatory for USB: */
142
143 /* power management */
144 OID_PNP_CAPABILITIES,
145 OID_PNP_QUERY_POWER,
146 OID_PNP_SET_POWER,
147
148 /* wake up host */
149 OID_PNP_ENABLE_WAKE_UP,
150 OID_PNP_ADD_WAKE_UP_PATTERN,
151 OID_PNP_REMOVE_WAKE_UP_PATTERN,
152#endif
153};
154
155
156typedef struct rndis_init_msg_type 72typedef struct rndis_init_msg_type
157{ 73{
158 __le32 MessageType; 74 __le32 MessageType;
@@ -309,15 +225,18 @@ typedef struct rndis_resp_t
309typedef struct rndis_params 225typedef struct rndis_params
310{ 226{
311 u8 confignr; 227 u8 confignr;
312 int used; 228 u8 used;
229 u16 saved_filter;
313 enum rndis_state state; 230 enum rndis_state state;
314 u32 filter;
315 u32 medium; 231 u32 medium;
316 u32 speed; 232 u32 speed;
317 u32 media_state; 233 u32 media_state;
234
318 const u8 *host_mac; 235 const u8 *host_mac;
236 u16 *filter;
319 struct net_device *dev; 237 struct net_device *dev;
320 struct net_device_stats *stats; 238 struct net_device_stats *stats;
239
321 u32 vendorID; 240 u32 vendorID;
322 const char *vendorDescr; 241 const char *vendorDescr;
323 int (*ack) (struct net_device *); 242 int (*ack) (struct net_device *);
@@ -329,7 +248,8 @@ int rndis_msg_parser (u8 configNr, u8 *buf);
329int rndis_register (int (*rndis_control_ack) (struct net_device *)); 248int rndis_register (int (*rndis_control_ack) (struct net_device *));
330void rndis_deregister (int configNr); 249void rndis_deregister (int configNr);
331int rndis_set_param_dev (u8 configNr, struct net_device *dev, 250int rndis_set_param_dev (u8 configNr, struct net_device *dev,
332 struct net_device_stats *stats); 251 struct net_device_stats *stats,
252 u16 *cdc_filter);
333int rndis_set_param_vendor (u8 configNr, u32 vendorID, 253int rndis_set_param_vendor (u8 configNr, u32 vendorID,
334 const char *vendorDescr); 254 const char *vendorDescr);
335int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed); 255int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed);
@@ -338,6 +258,7 @@ int rndis_rm_hdr (struct sk_buff *skb);
338u8 *rndis_get_next_response (int configNr, u32 *length); 258u8 *rndis_get_next_response (int configNr, u32 *length);
339void rndis_free_response (int configNr, u8 *buf); 259void rndis_free_response (int configNr, u8 *buf);
340 260
261void rndis_uninit (int configNr);
341int rndis_signal_connect (int configNr); 262int rndis_signal_connect (int configNr);
342int rndis_signal_disconnect (int configNr); 263int rndis_signal_disconnect (int configNr);
343int rndis_state (int configNr); 264int rndis_state (int configNr);