aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-01 20:35:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:42 -0400
commit70790f6339a868e2a0d643f44899418f64a95943 (patch)
tree406a1259b869b0b157a65e89e963afd0f20d1644 /drivers
parentc67ab134ba9f83f9de86e58adfeaa14a9efa6e00 (diff)
USB: usb gadget stack can now -DDEBUG with Kconfig
Although the other USB driver directories got taught how use Kconfig and the Makefile to enable the debugging messages enabled by -DDEBUG, the gadget stack was overlooked. This patch remedies that omission, but doesn't update any drivers to remove previous idiosyncracies in this area ... other than the RNDIS code, which defined its own DEBUG() macro in a broken way. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/Kconfig14
-rw-r--r--drivers/usb/gadget/Makefile4
-rw-r--r--drivers/usb/gadget/rndis.c164
3 files changed, 100 insertions, 82 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 74eaa7de525f..45e01e289455 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -42,6 +42,20 @@ config USB_GADGET
42 For more information, see <http://www.linux-usb.org/gadget> and 42 For more information, see <http://www.linux-usb.org/gadget> and
43 the kernel DocBook documentation for this API. 43 the kernel DocBook documentation for this API.
44 44
45config USB_GADGET_DEBUG
46 boolean "Debugging messages"
47 depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
48 help
49 Many controller and gadget drivers will print some debugging
50 messages if you use this option to ask for those messages.
51
52 Avoid enabling these messages, even if you're actively
53 debugging such a driver. Many drivers will emit so many
54 messages that the driver timings are affected, which will
55 either create new failure modes or remove the one you're
56 trying to track down. Never enable these messages for a
57 production build.
58
45config USB_GADGET_DEBUG_FILES 59config USB_GADGET_DEBUG_FILES
46 boolean "Debugging information files" 60 boolean "Debugging information files"
47 depends on USB_GADGET && PROC_FS 61 depends on USB_GADGET && PROC_FS
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index bff27832779b..8ae76f738635 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -1,6 +1,10 @@
1# 1#
2# USB peripheral controller drivers 2# USB peripheral controller drivers
3# 3#
4ifeq ($(CONFIG_USB_GADGET_DEBUG),y)
5 EXTRA_CFLAGS += -DDEBUG
6endif
7
4obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o 8obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
5obj-$(CONFIG_USB_NET2280) += net2280.o 9obj-$(CONFIG_USB_NET2280) += net2280.o
6obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o 10obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 708657c89132..db1b2bfcee4e 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -53,7 +53,7 @@
53 */ 53 */
54 54
55#if 0 55#if 0
56#define DEBUG(str,args...) do { \ 56#define DBG(str,args...) do { \
57 if (rndis_debug) \ 57 if (rndis_debug) \
58 printk(KERN_DEBUG str , ## args ); \ 58 printk(KERN_DEBUG str , ## args ); \
59 } while (0) 59 } while (0)
@@ -65,7 +65,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
65#else 65#else
66 66
67#define rndis_debug 0 67#define rndis_debug 0
68#define DEBUG(str,args...) do{}while(0) 68#define DBG(str,args...) do{}while(0)
69#endif 69#endif
70 70
71#define RNDIS_MAX_CONFIGS 1 71#define RNDIS_MAX_CONFIGS 1
@@ -183,9 +183,9 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
183 if (!resp) return -ENOMEM; 183 if (!resp) return -ENOMEM;
184 184
185 if (buf_len && rndis_debug > 1) { 185 if (buf_len && rndis_debug > 1) {
186 DEBUG("query OID %08x value, len %d:\n", OID, buf_len); 186 DBG("query OID %08x value, len %d:\n", OID, buf_len);
187 for (i = 0; i < buf_len; i += 16) { 187 for (i = 0; i < buf_len; i += 16) {
188 DEBUG ("%03d: %08x %08x %08x %08x\n", i, 188 DBG("%03d: %08x %08x %08x %08x\n", i,
189 le32_to_cpu(get_unaligned((__le32 *) 189 le32_to_cpu(get_unaligned((__le32 *)
190 &buf[i])), 190 &buf[i])),
191 le32_to_cpu(get_unaligned((__le32 *) 191 le32_to_cpu(get_unaligned((__le32 *)
@@ -207,7 +207,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
207 207
208 /* mandatory */ 208 /* mandatory */
209 case OID_GEN_SUPPORTED_LIST: 209 case OID_GEN_SUPPORTED_LIST:
210 DEBUG ("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__); 210 DBG("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__);
211 length = sizeof (oid_supported_list); 211 length = sizeof (oid_supported_list);
212 count = length / sizeof (u32); 212 count = length / sizeof (u32);
213 for (i = 0; i < count; i++) 213 for (i = 0; i < count; i++)
@@ -217,7 +217,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
217 217
218 /* mandatory */ 218 /* mandatory */
219 case OID_GEN_HARDWARE_STATUS: 219 case OID_GEN_HARDWARE_STATUS:
220 DEBUG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__); 220 DBG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__);
221 /* Bogus question! 221 /* Bogus question!
222 * Hardware must be ready to receive high level protocols. 222 * Hardware must be ready to receive high level protocols.
223 * BTW: 223 * BTW:
@@ -230,14 +230,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
230 230
231 /* mandatory */ 231 /* mandatory */
232 case OID_GEN_MEDIA_SUPPORTED: 232 case OID_GEN_MEDIA_SUPPORTED:
233 DEBUG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__); 233 DBG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__);
234 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); 234 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
235 retval = 0; 235 retval = 0;
236 break; 236 break;
237 237
238 /* mandatory */ 238 /* mandatory */
239 case OID_GEN_MEDIA_IN_USE: 239 case OID_GEN_MEDIA_IN_USE:
240 DEBUG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__); 240 DBG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__);
241 /* one medium, one transport... (maybe you do it better) */ 241 /* one medium, one transport... (maybe you do it better) */
242 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); 242 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
243 retval = 0; 243 retval = 0;
@@ -245,7 +245,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
245 245
246 /* mandatory */ 246 /* mandatory */
247 case OID_GEN_MAXIMUM_FRAME_SIZE: 247 case OID_GEN_MAXIMUM_FRAME_SIZE:
248 DEBUG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__); 248 DBG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__);
249 if (rndis_per_dev_params [configNr].dev) { 249 if (rndis_per_dev_params [configNr].dev) {
250 *outbuf = cpu_to_le32 ( 250 *outbuf = cpu_to_le32 (
251 rndis_per_dev_params [configNr].dev->mtu); 251 rndis_per_dev_params [configNr].dev->mtu);
@@ -256,7 +256,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
256 /* mandatory */ 256 /* mandatory */
257 case OID_GEN_LINK_SPEED: 257 case OID_GEN_LINK_SPEED:
258 if (rndis_debug > 1) 258 if (rndis_debug > 1)
259 DEBUG("%s: OID_GEN_LINK_SPEED\n", __FUNCTION__); 259 DBG("%s: OID_GEN_LINK_SPEED\n", __FUNCTION__);
260 if (rndis_per_dev_params [configNr].media_state 260 if (rndis_per_dev_params [configNr].media_state
261 == NDIS_MEDIA_STATE_DISCONNECTED) 261 == NDIS_MEDIA_STATE_DISCONNECTED)
262 *outbuf = __constant_cpu_to_le32 (0); 262 *outbuf = __constant_cpu_to_le32 (0);
@@ -268,7 +268,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
268 268
269 /* mandatory */ 269 /* mandatory */
270 case OID_GEN_TRANSMIT_BLOCK_SIZE: 270 case OID_GEN_TRANSMIT_BLOCK_SIZE:
271 DEBUG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __FUNCTION__); 271 DBG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __FUNCTION__);
272 if (rndis_per_dev_params [configNr].dev) { 272 if (rndis_per_dev_params [configNr].dev) {
273 *outbuf = cpu_to_le32 ( 273 *outbuf = cpu_to_le32 (
274 rndis_per_dev_params [configNr].dev->mtu); 274 rndis_per_dev_params [configNr].dev->mtu);
@@ -278,7 +278,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
278 278
279 /* mandatory */ 279 /* mandatory */
280 case OID_GEN_RECEIVE_BLOCK_SIZE: 280 case OID_GEN_RECEIVE_BLOCK_SIZE:
281 DEBUG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__); 281 DBG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__);
282 if (rndis_per_dev_params [configNr].dev) { 282 if (rndis_per_dev_params [configNr].dev) {
283 *outbuf = cpu_to_le32 ( 283 *outbuf = cpu_to_le32 (
284 rndis_per_dev_params [configNr].dev->mtu); 284 rndis_per_dev_params [configNr].dev->mtu);
@@ -288,7 +288,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
288 288
289 /* mandatory */ 289 /* mandatory */
290 case OID_GEN_VENDOR_ID: 290 case OID_GEN_VENDOR_ID:
291 DEBUG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__); 291 DBG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__);
292 *outbuf = cpu_to_le32 ( 292 *outbuf = cpu_to_le32 (
293 rndis_per_dev_params [configNr].vendorID); 293 rndis_per_dev_params [configNr].vendorID);
294 retval = 0; 294 retval = 0;
@@ -296,7 +296,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
296 296
297 /* mandatory */ 297 /* mandatory */
298 case OID_GEN_VENDOR_DESCRIPTION: 298 case OID_GEN_VENDOR_DESCRIPTION:
299 DEBUG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __FUNCTION__); 299 DBG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __FUNCTION__);
300 length = strlen (rndis_per_dev_params [configNr].vendorDescr); 300 length = strlen (rndis_per_dev_params [configNr].vendorDescr);
301 memcpy (outbuf, 301 memcpy (outbuf,
302 rndis_per_dev_params [configNr].vendorDescr, length); 302 rndis_per_dev_params [configNr].vendorDescr, length);
@@ -304,7 +304,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
304 break; 304 break;
305 305
306 case OID_GEN_VENDOR_DRIVER_VERSION: 306 case OID_GEN_VENDOR_DRIVER_VERSION:
307 DEBUG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__); 307 DBG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__);
308 /* Created as LE */ 308 /* Created as LE */
309 *outbuf = rndis_driver_version; 309 *outbuf = rndis_driver_version;
310 retval = 0; 310 retval = 0;
@@ -312,14 +312,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
312 312
313 /* mandatory */ 313 /* mandatory */
314 case OID_GEN_CURRENT_PACKET_FILTER: 314 case OID_GEN_CURRENT_PACKET_FILTER:
315 DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__); 315 DBG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__);
316 *outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter); 316 *outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter);
317 retval = 0; 317 retval = 0;
318 break; 318 break;
319 319
320 /* mandatory */ 320 /* mandatory */
321 case OID_GEN_MAXIMUM_TOTAL_SIZE: 321 case OID_GEN_MAXIMUM_TOTAL_SIZE:
322 DEBUG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __FUNCTION__); 322 DBG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __FUNCTION__);
323 *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE); 323 *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
324 retval = 0; 324 retval = 0;
325 break; 325 break;
@@ -327,14 +327,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
327 /* mandatory */ 327 /* mandatory */
328 case OID_GEN_MEDIA_CONNECT_STATUS: 328 case OID_GEN_MEDIA_CONNECT_STATUS:
329 if (rndis_debug > 1) 329 if (rndis_debug > 1)
330 DEBUG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __FUNCTION__); 330 DBG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __FUNCTION__);
331 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 331 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
332 .media_state); 332 .media_state);
333 retval = 0; 333 retval = 0;
334 break; 334 break;
335 335
336 case OID_GEN_PHYSICAL_MEDIUM: 336 case OID_GEN_PHYSICAL_MEDIUM:
337 DEBUG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__); 337 DBG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__);
338 *outbuf = __constant_cpu_to_le32 (0); 338 *outbuf = __constant_cpu_to_le32 (0);
339 retval = 0; 339 retval = 0;
340 break; 340 break;
@@ -344,7 +344,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
344 * versions emit undefined RNDIS messages. DOCUMENT ALL THESE! 344 * versions emit undefined RNDIS messages. DOCUMENT ALL THESE!
345 */ 345 */
346 case OID_GEN_MAC_OPTIONS: /* from WinME */ 346 case OID_GEN_MAC_OPTIONS: /* from WinME */
347 DEBUG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__); 347 DBG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__);
348 *outbuf = __constant_cpu_to_le32( 348 *outbuf = __constant_cpu_to_le32(
349 NDIS_MAC_OPTION_RECEIVE_SERIALIZED 349 NDIS_MAC_OPTION_RECEIVE_SERIALIZED
350 | NDIS_MAC_OPTION_FULL_DUPLEX); 350 | NDIS_MAC_OPTION_FULL_DUPLEX);
@@ -356,7 +356,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
356 /* mandatory */ 356 /* mandatory */
357 case OID_GEN_XMIT_OK: 357 case OID_GEN_XMIT_OK:
358 if (rndis_debug > 1) 358 if (rndis_debug > 1)
359 DEBUG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__); 359 DBG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__);
360 if (rndis_per_dev_params [configNr].stats) { 360 if (rndis_per_dev_params [configNr].stats) {
361 *outbuf = cpu_to_le32 ( 361 *outbuf = cpu_to_le32 (
362 rndis_per_dev_params [configNr].stats->tx_packets - 362 rndis_per_dev_params [configNr].stats->tx_packets -
@@ -369,7 +369,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
369 /* mandatory */ 369 /* mandatory */
370 case OID_GEN_RCV_OK: 370 case OID_GEN_RCV_OK:
371 if (rndis_debug > 1) 371 if (rndis_debug > 1)
372 DEBUG("%s: OID_GEN_RCV_OK\n", __FUNCTION__); 372 DBG("%s: OID_GEN_RCV_OK\n", __FUNCTION__);
373 if (rndis_per_dev_params [configNr].stats) { 373 if (rndis_per_dev_params [configNr].stats) {
374 *outbuf = cpu_to_le32 ( 374 *outbuf = cpu_to_le32 (
375 rndis_per_dev_params [configNr].stats->rx_packets - 375 rndis_per_dev_params [configNr].stats->rx_packets -
@@ -382,7 +382,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
382 /* mandatory */ 382 /* mandatory */
383 case OID_GEN_XMIT_ERROR: 383 case OID_GEN_XMIT_ERROR:
384 if (rndis_debug > 1) 384 if (rndis_debug > 1)
385 DEBUG("%s: OID_GEN_XMIT_ERROR\n", __FUNCTION__); 385 DBG("%s: OID_GEN_XMIT_ERROR\n", __FUNCTION__);
386 if (rndis_per_dev_params [configNr].stats) { 386 if (rndis_per_dev_params [configNr].stats) {
387 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 387 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
388 .stats->tx_errors); 388 .stats->tx_errors);
@@ -393,7 +393,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
393 /* mandatory */ 393 /* mandatory */
394 case OID_GEN_RCV_ERROR: 394 case OID_GEN_RCV_ERROR:
395 if (rndis_debug > 1) 395 if (rndis_debug > 1)
396 DEBUG("%s: OID_GEN_RCV_ERROR\n", __FUNCTION__); 396 DBG("%s: OID_GEN_RCV_ERROR\n", __FUNCTION__);
397 if (rndis_per_dev_params [configNr].stats) { 397 if (rndis_per_dev_params [configNr].stats) {
398 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 398 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
399 .stats->rx_errors); 399 .stats->rx_errors);
@@ -403,7 +403,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
403 403
404 /* mandatory */ 404 /* mandatory */
405 case OID_GEN_RCV_NO_BUFFER: 405 case OID_GEN_RCV_NO_BUFFER:
406 DEBUG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__); 406 DBG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__);
407 if (rndis_per_dev_params [configNr].stats) { 407 if (rndis_per_dev_params [configNr].stats) {
408 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 408 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
409 .stats->rx_dropped); 409 .stats->rx_dropped);
@@ -413,7 +413,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
413 413
414#ifdef RNDIS_OPTIONAL_STATS 414#ifdef RNDIS_OPTIONAL_STATS
415 case OID_GEN_DIRECTED_BYTES_XMIT: 415 case OID_GEN_DIRECTED_BYTES_XMIT:
416 DEBUG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__); 416 DBG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__);
417 /* 417 /*
418 * Aunt Tilly's size of shoes 418 * Aunt Tilly's size of shoes
419 * minus antarctica count of penguins 419 * minus antarctica count of penguins
@@ -433,7 +433,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
433 break; 433 break;
434 434
435 case OID_GEN_DIRECTED_FRAMES_XMIT: 435 case OID_GEN_DIRECTED_FRAMES_XMIT:
436 DEBUG("%s: OID_GEN_DIRECTED_FRAMES_XMIT\n", __FUNCTION__); 436 DBG("%s: OID_GEN_DIRECTED_FRAMES_XMIT\n", __FUNCTION__);
437 /* dito */ 437 /* dito */
438 if (rndis_per_dev_params [configNr].stats) { 438 if (rndis_per_dev_params [configNr].stats) {
439 *outbuf = cpu_to_le32 ( 439 *outbuf = cpu_to_le32 (
@@ -449,7 +449,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
449 break; 449 break;
450 450
451 case OID_GEN_MULTICAST_BYTES_XMIT: 451 case OID_GEN_MULTICAST_BYTES_XMIT:
452 DEBUG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__); 452 DBG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__);
453 if (rndis_per_dev_params [configNr].stats) { 453 if (rndis_per_dev_params [configNr].stats) {
454 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 454 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
455 .stats->multicast*1234); 455 .stats->multicast*1234);
@@ -458,7 +458,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
458 break; 458 break;
459 459
460 case OID_GEN_MULTICAST_FRAMES_XMIT: 460 case OID_GEN_MULTICAST_FRAMES_XMIT:
461 DEBUG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__); 461 DBG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__);
462 if (rndis_per_dev_params [configNr].stats) { 462 if (rndis_per_dev_params [configNr].stats) {
463 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 463 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
464 .stats->multicast); 464 .stats->multicast);
@@ -467,7 +467,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
467 break; 467 break;
468 468
469 case OID_GEN_BROADCAST_BYTES_XMIT: 469 case OID_GEN_BROADCAST_BYTES_XMIT:
470 DEBUG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__); 470 DBG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__);
471 if (rndis_per_dev_params [configNr].stats) { 471 if (rndis_per_dev_params [configNr].stats) {
472 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 472 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
473 .stats->tx_packets/42*255); 473 .stats->tx_packets/42*255);
@@ -476,7 +476,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
476 break; 476 break;
477 477
478 case OID_GEN_BROADCAST_FRAMES_XMIT: 478 case OID_GEN_BROADCAST_FRAMES_XMIT:
479 DEBUG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__); 479 DBG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__);
480 if (rndis_per_dev_params [configNr].stats) { 480 if (rndis_per_dev_params [configNr].stats) {
481 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 481 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
482 .stats->tx_packets/42); 482 .stats->tx_packets/42);
@@ -485,19 +485,19 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
485 break; 485 break;
486 486
487 case OID_GEN_DIRECTED_BYTES_RCV: 487 case OID_GEN_DIRECTED_BYTES_RCV:
488 DEBUG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__); 488 DBG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__);
489 *outbuf = __constant_cpu_to_le32 (0); 489 *outbuf = __constant_cpu_to_le32 (0);
490 retval = 0; 490 retval = 0;
491 break; 491 break;
492 492
493 case OID_GEN_DIRECTED_FRAMES_RCV: 493 case OID_GEN_DIRECTED_FRAMES_RCV:
494 DEBUG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__); 494 DBG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__);
495 *outbuf = __constant_cpu_to_le32 (0); 495 *outbuf = __constant_cpu_to_le32 (0);
496 retval = 0; 496 retval = 0;
497 break; 497 break;
498 498
499 case OID_GEN_MULTICAST_BYTES_RCV: 499 case OID_GEN_MULTICAST_BYTES_RCV:
500 DEBUG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__); 500 DBG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__);
501 if (rndis_per_dev_params [configNr].stats) { 501 if (rndis_per_dev_params [configNr].stats) {
502 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 502 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
503 .stats->multicast * 1111); 503 .stats->multicast * 1111);
@@ -506,7 +506,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
506 break; 506 break;
507 507
508 case OID_GEN_MULTICAST_FRAMES_RCV: 508 case OID_GEN_MULTICAST_FRAMES_RCV:
509 DEBUG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__); 509 DBG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__);
510 if (rndis_per_dev_params [configNr].stats) { 510 if (rndis_per_dev_params [configNr].stats) {
511 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 511 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
512 .stats->multicast); 512 .stats->multicast);
@@ -515,7 +515,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
515 break; 515 break;
516 516
517 case OID_GEN_BROADCAST_BYTES_RCV: 517 case OID_GEN_BROADCAST_BYTES_RCV:
518 DEBUG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__); 518 DBG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__);
519 if (rndis_per_dev_params [configNr].stats) { 519 if (rndis_per_dev_params [configNr].stats) {
520 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 520 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
521 .stats->rx_packets/42*255); 521 .stats->rx_packets/42*255);
@@ -524,7 +524,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
524 break; 524 break;
525 525
526 case OID_GEN_BROADCAST_FRAMES_RCV: 526 case OID_GEN_BROADCAST_FRAMES_RCV:
527 DEBUG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__); 527 DBG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__);
528 if (rndis_per_dev_params [configNr].stats) { 528 if (rndis_per_dev_params [configNr].stats) {
529 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 529 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
530 .stats->rx_packets/42); 530 .stats->rx_packets/42);
@@ -533,7 +533,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
533 break; 533 break;
534 534
535 case OID_GEN_RCV_CRC_ERROR: 535 case OID_GEN_RCV_CRC_ERROR:
536 DEBUG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__); 536 DBG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__);
537 if (rndis_per_dev_params [configNr].stats) { 537 if (rndis_per_dev_params [configNr].stats) {
538 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 538 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
539 .stats->rx_crc_errors); 539 .stats->rx_crc_errors);
@@ -542,7 +542,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
542 break; 542 break;
543 543
544 case OID_GEN_TRANSMIT_QUEUE_LENGTH: 544 case OID_GEN_TRANSMIT_QUEUE_LENGTH:
545 DEBUG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__); 545 DBG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__);
546 *outbuf = __constant_cpu_to_le32 (0); 546 *outbuf = __constant_cpu_to_le32 (0);
547 retval = 0; 547 retval = 0;
548 break; 548 break;
@@ -552,7 +552,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
552 552
553 /* mandatory */ 553 /* mandatory */
554 case OID_802_3_PERMANENT_ADDRESS: 554 case OID_802_3_PERMANENT_ADDRESS:
555 DEBUG("%s: OID_802_3_PERMANENT_ADDRESS\n", __FUNCTION__); 555 DBG("%s: OID_802_3_PERMANENT_ADDRESS\n", __FUNCTION__);
556 if (rndis_per_dev_params [configNr].dev) { 556 if (rndis_per_dev_params [configNr].dev) {
557 length = ETH_ALEN; 557 length = ETH_ALEN;
558 memcpy (outbuf, 558 memcpy (outbuf,
@@ -564,7 +564,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
564 564
565 /* mandatory */ 565 /* mandatory */
566 case OID_802_3_CURRENT_ADDRESS: 566 case OID_802_3_CURRENT_ADDRESS:
567 DEBUG("%s: OID_802_3_CURRENT_ADDRESS\n", __FUNCTION__); 567 DBG("%s: OID_802_3_CURRENT_ADDRESS\n", __FUNCTION__);
568 if (rndis_per_dev_params [configNr].dev) { 568 if (rndis_per_dev_params [configNr].dev) {
569 length = ETH_ALEN; 569 length = ETH_ALEN;
570 memcpy (outbuf, 570 memcpy (outbuf,
@@ -576,7 +576,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
576 576
577 /* mandatory */ 577 /* mandatory */
578 case OID_802_3_MULTICAST_LIST: 578 case OID_802_3_MULTICAST_LIST:
579 DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); 579 DBG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
580 /* Multicast base address only */ 580 /* Multicast base address only */
581 *outbuf = __constant_cpu_to_le32 (0xE0000000); 581 *outbuf = __constant_cpu_to_le32 (0xE0000000);
582 retval = 0; 582 retval = 0;
@@ -584,21 +584,21 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
584 584
585 /* mandatory */ 585 /* mandatory */
586 case OID_802_3_MAXIMUM_LIST_SIZE: 586 case OID_802_3_MAXIMUM_LIST_SIZE:
587 DEBUG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__); 587 DBG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__);
588 /* Multicast base address only */ 588 /* Multicast base address only */
589 *outbuf = __constant_cpu_to_le32 (1); 589 *outbuf = __constant_cpu_to_le32 (1);
590 retval = 0; 590 retval = 0;
591 break; 591 break;
592 592
593 case OID_802_3_MAC_OPTIONS: 593 case OID_802_3_MAC_OPTIONS:
594 DEBUG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__); 594 DBG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__);
595 break; 595 break;
596 596
597 /* ieee802.3 statistics OIDs (table 4-4) */ 597 /* ieee802.3 statistics OIDs (table 4-4) */
598 598
599 /* mandatory */ 599 /* mandatory */
600 case OID_802_3_RCV_ERROR_ALIGNMENT: 600 case OID_802_3_RCV_ERROR_ALIGNMENT:
601 DEBUG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __FUNCTION__); 601 DBG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __FUNCTION__);
602 if (rndis_per_dev_params [configNr].stats) { 602 if (rndis_per_dev_params [configNr].stats) {
603 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] 603 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
604 .stats->rx_frame_errors); 604 .stats->rx_frame_errors);
@@ -608,51 +608,51 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
608 608
609 /* mandatory */ 609 /* mandatory */
610 case OID_802_3_XMIT_ONE_COLLISION: 610 case OID_802_3_XMIT_ONE_COLLISION:
611 DEBUG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__); 611 DBG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__);
612 *outbuf = __constant_cpu_to_le32 (0); 612 *outbuf = __constant_cpu_to_le32 (0);
613 retval = 0; 613 retval = 0;
614 break; 614 break;
615 615
616 /* mandatory */ 616 /* mandatory */
617 case OID_802_3_XMIT_MORE_COLLISIONS: 617 case OID_802_3_XMIT_MORE_COLLISIONS:
618 DEBUG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__); 618 DBG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__);
619 *outbuf = __constant_cpu_to_le32 (0); 619 *outbuf = __constant_cpu_to_le32 (0);
620 retval = 0; 620 retval = 0;
621 break; 621 break;
622 622
623#ifdef RNDIS_OPTIONAL_STATS 623#ifdef RNDIS_OPTIONAL_STATS
624 case OID_802_3_XMIT_DEFERRED: 624 case OID_802_3_XMIT_DEFERRED:
625 DEBUG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__); 625 DBG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__);
626 /* TODO */ 626 /* TODO */
627 break; 627 break;
628 628
629 case OID_802_3_XMIT_MAX_COLLISIONS: 629 case OID_802_3_XMIT_MAX_COLLISIONS:
630 DEBUG("%s: OID_802_3_XMIT_MAX_COLLISIONS\n", __FUNCTION__); 630 DBG("%s: OID_802_3_XMIT_MAX_COLLISIONS\n", __FUNCTION__);
631 /* TODO */ 631 /* TODO */
632 break; 632 break;
633 633
634 case OID_802_3_RCV_OVERRUN: 634 case OID_802_3_RCV_OVERRUN:
635 DEBUG("%s: OID_802_3_RCV_OVERRUN\n", __FUNCTION__); 635 DBG("%s: OID_802_3_RCV_OVERRUN\n", __FUNCTION__);
636 /* TODO */ 636 /* TODO */
637 break; 637 break;
638 638
639 case OID_802_3_XMIT_UNDERRUN: 639 case OID_802_3_XMIT_UNDERRUN:
640 DEBUG("%s: OID_802_3_XMIT_UNDERRUN\n", __FUNCTION__); 640 DBG("%s: OID_802_3_XMIT_UNDERRUN\n", __FUNCTION__);
641 /* TODO */ 641 /* TODO */
642 break; 642 break;
643 643
644 case OID_802_3_XMIT_HEARTBEAT_FAILURE: 644 case OID_802_3_XMIT_HEARTBEAT_FAILURE:
645 DEBUG("%s: OID_802_3_XMIT_HEARTBEAT_FAILURE\n", __FUNCTION__); 645 DBG("%s: OID_802_3_XMIT_HEARTBEAT_FAILURE\n", __FUNCTION__);
646 /* TODO */ 646 /* TODO */
647 break; 647 break;
648 648
649 case OID_802_3_XMIT_TIMES_CRS_LOST: 649 case OID_802_3_XMIT_TIMES_CRS_LOST:
650 DEBUG("%s: OID_802_3_XMIT_TIMES_CRS_LOST\n", __FUNCTION__); 650 DBG("%s: OID_802_3_XMIT_TIMES_CRS_LOST\n", __FUNCTION__);
651 /* TODO */ 651 /* TODO */
652 break; 652 break;
653 653
654 case OID_802_3_XMIT_LATE_COLLISIONS: 654 case OID_802_3_XMIT_LATE_COLLISIONS:
655 DEBUG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__); 655 DBG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__);
656 /* TODO */ 656 /* TODO */
657 break; 657 break;
658#endif /* RNDIS_OPTIONAL_STATS */ 658#endif /* RNDIS_OPTIONAL_STATS */
@@ -660,7 +660,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
660#ifdef RNDIS_PM 660#ifdef RNDIS_PM
661 /* power management OIDs (table 4-5) */ 661 /* power management OIDs (table 4-5) */
662 case OID_PNP_CAPABILITIES: 662 case OID_PNP_CAPABILITIES:
663 DEBUG("%s: OID_PNP_CAPABILITIES\n", __FUNCTION__); 663 DBG("%s: OID_PNP_CAPABILITIES\n", __FUNCTION__);
664 664
665 /* for now, no wakeup capabilities */ 665 /* for now, no wakeup capabilities */
666 length = sizeof (struct NDIS_PNP_CAPABILITIES); 666 length = sizeof (struct NDIS_PNP_CAPABILITIES);
@@ -668,7 +668,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
668 retval = 0; 668 retval = 0;
669 break; 669 break;
670 case OID_PNP_QUERY_POWER: 670 case OID_PNP_QUERY_POWER:
671 DEBUG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__, 671 DBG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__,
672 le32_to_cpu(get_unaligned((__le32 *)buf)) - 1); 672 le32_to_cpu(get_unaligned((__le32 *)buf)) - 1);
673 /* only suspend is a real power state, and 673 /* only suspend is a real power state, and
674 * it can't be entered by OID_PNP_SET_POWER... 674 * it can't be entered by OID_PNP_SET_POWER...
@@ -705,9 +705,9 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
705 return -ENOMEM; 705 return -ENOMEM;
706 706
707 if (buf_len && rndis_debug > 1) { 707 if (buf_len && rndis_debug > 1) {
708 DEBUG("set OID %08x value, len %d:\n", OID, buf_len); 708 DBG("set OID %08x value, len %d:\n", OID, buf_len);
709 for (i = 0; i < buf_len; i += 16) { 709 for (i = 0; i < buf_len; i += 16) {
710 DEBUG ("%03d: %08x %08x %08x %08x\n", i, 710 DBG("%03d: %08x %08x %08x %08x\n", i,
711 le32_to_cpu(get_unaligned((__le32 *) 711 le32_to_cpu(get_unaligned((__le32 *)
712 &buf[i])), 712 &buf[i])),
713 le32_to_cpu(get_unaligned((__le32 *) 713 le32_to_cpu(get_unaligned((__le32 *)
@@ -731,7 +731,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
731 */ 731 */
732 *params->filter = (u16) le32_to_cpu(get_unaligned( 732 *params->filter = (u16) le32_to_cpu(get_unaligned(
733 (__le32 *)buf)); 733 (__le32 *)buf));
734 DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n", 734 DBG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
735 __FUNCTION__, *params->filter); 735 __FUNCTION__, *params->filter);
736 736
737 /* this call has a significant side effect: it's 737 /* this call has a significant side effect: it's
@@ -756,7 +756,7 @@ update_linkstate:
756 756
757 case OID_802_3_MULTICAST_LIST: 757 case OID_802_3_MULTICAST_LIST:
758 /* I think we can ignore this */ 758 /* I think we can ignore this */
759 DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); 759 DBG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
760 retval = 0; 760 retval = 0;
761 break; 761 break;
762#if 0 762#if 0
@@ -764,7 +764,7 @@ update_linkstate:
764 { 764 {
765 struct rndis_config_parameter *param; 765 struct rndis_config_parameter *param;
766 param = (struct rndis_config_parameter *) buf; 766 param = (struct rndis_config_parameter *) buf;
767 DEBUG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER '%*s'\n", 767 DBG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER '%*s'\n",
768 __FUNCTION__, 768 __FUNCTION__,
769 min(cpu_to_le32(param->ParameterNameLength),80), 769 min(cpu_to_le32(param->ParameterNameLength),80),
770 buf + param->ParameterNameOffset); 770 buf + param->ParameterNameOffset);
@@ -781,7 +781,7 @@ update_linkstate:
781 * FIXME ... then things go batty; Windows wedges itself. 781 * FIXME ... then things go batty; Windows wedges itself.
782 */ 782 */
783 i = le32_to_cpu(get_unaligned((__le32 *)buf)); 783 i = le32_to_cpu(get_unaligned((__le32 *)buf));
784 DEBUG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1); 784 DBG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1);
785 switch (i) { 785 switch (i) {
786 case NdisDeviceStateD0: 786 case NdisDeviceStateD0:
787 *params->filter = params->saved_filter; 787 *params->filter = params->saved_filter;
@@ -858,7 +858,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
858 rndis_query_cmplt_type *resp; 858 rndis_query_cmplt_type *resp;
859 rndis_resp_t *r; 859 rndis_resp_t *r;
860 860
861 // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); 861 // DBG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID));
862 if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; 862 if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
863 863
864 /* 864 /*
@@ -911,15 +911,15 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
911 BufOffset = le32_to_cpu (buf->InformationBufferOffset); 911 BufOffset = le32_to_cpu (buf->InformationBufferOffset);
912 912
913#ifdef VERBOSE 913#ifdef VERBOSE
914 DEBUG("%s: Length: %d\n", __FUNCTION__, BufLength); 914 DBG("%s: Length: %d\n", __FUNCTION__, BufLength);
915 DEBUG("%s: Offset: %d\n", __FUNCTION__, BufOffset); 915 DBG("%s: Offset: %d\n", __FUNCTION__, BufOffset);
916 DEBUG("%s: InfoBuffer: ", __FUNCTION__); 916 DBG("%s: InfoBuffer: ", __FUNCTION__);
917 917
918 for (i = 0; i < BufLength; i++) { 918 for (i = 0; i < BufLength; i++) {
919 DEBUG ("%02x ", *(((u8 *) buf) + i + 8 + BufOffset)); 919 DBG("%02x ", *(((u8 *) buf) + i + 8 + BufOffset));
920 } 920 }
921 921
922 DEBUG ("\n"); 922 DBG("\n");
923#endif 923#endif
924 924
925 resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT); 925 resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
@@ -1082,14 +1082,14 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
1082 /* For USB: responses may take up to 10 seconds */ 1082 /* For USB: responses may take up to 10 seconds */
1083 switch (MsgType) { 1083 switch (MsgType) {
1084 case REMOTE_NDIS_INITIALIZE_MSG: 1084 case REMOTE_NDIS_INITIALIZE_MSG:
1085 DEBUG("%s: REMOTE_NDIS_INITIALIZE_MSG\n", 1085 DBG("%s: REMOTE_NDIS_INITIALIZE_MSG\n",
1086 __FUNCTION__ ); 1086 __FUNCTION__ );
1087 params->state = RNDIS_INITIALIZED; 1087 params->state = RNDIS_INITIALIZED;
1088 return rndis_init_response (configNr, 1088 return rndis_init_response (configNr,
1089 (rndis_init_msg_type *) buf); 1089 (rndis_init_msg_type *) buf);
1090 1090
1091 case REMOTE_NDIS_HALT_MSG: 1091 case REMOTE_NDIS_HALT_MSG:
1092 DEBUG("%s: REMOTE_NDIS_HALT_MSG\n", 1092 DBG("%s: REMOTE_NDIS_HALT_MSG\n",
1093 __FUNCTION__ ); 1093 __FUNCTION__ );
1094 params->state = RNDIS_UNINITIALIZED; 1094 params->state = RNDIS_UNINITIALIZED;
1095 if (params->dev) { 1095 if (params->dev) {
@@ -1107,7 +1107,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
1107 (rndis_set_msg_type *) buf); 1107 (rndis_set_msg_type *) buf);
1108 1108
1109 case REMOTE_NDIS_RESET_MSG: 1109 case REMOTE_NDIS_RESET_MSG:
1110 DEBUG("%s: REMOTE_NDIS_RESET_MSG\n", 1110 DBG("%s: REMOTE_NDIS_RESET_MSG\n",
1111 __FUNCTION__ ); 1111 __FUNCTION__ );
1112 return rndis_reset_response (configNr, 1112 return rndis_reset_response (configNr,
1113 (rndis_reset_msg_type *) buf); 1113 (rndis_reset_msg_type *) buf);
@@ -1115,7 +1115,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
1115 case REMOTE_NDIS_KEEPALIVE_MSG: 1115 case REMOTE_NDIS_KEEPALIVE_MSG:
1116 /* For USB: host does this every 5 seconds */ 1116 /* For USB: host does this every 5 seconds */
1117 if (rndis_debug > 1) 1117 if (rndis_debug > 1)
1118 DEBUG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n", 1118 DBG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n",
1119 __FUNCTION__ ); 1119 __FUNCTION__ );
1120 return rndis_keepalive_response (configNr, 1120 return rndis_keepalive_response (configNr,
1121 (rndis_keepalive_msg_type *) 1121 (rndis_keepalive_msg_type *)
@@ -1132,7 +1132,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
1132 { 1132 {
1133 unsigned i; 1133 unsigned i;
1134 for (i = 0; i < MsgLength; i += 16) { 1134 for (i = 0; i < MsgLength; i += 16) {
1135 DEBUG ("%03d: " 1135 DBG("%03d: "
1136 " %02x %02x %02x %02x" 1136 " %02x %02x %02x %02x"
1137 " %02x %02x %02x %02x" 1137 " %02x %02x %02x %02x"
1138 " %02x %02x %02x %02x" 1138 " %02x %02x %02x %02x"
@@ -1163,18 +1163,18 @@ int rndis_register (int (* rndis_control_ack) (struct net_device *))
1163 if (!rndis_per_dev_params [i].used) { 1163 if (!rndis_per_dev_params [i].used) {
1164 rndis_per_dev_params [i].used = 1; 1164 rndis_per_dev_params [i].used = 1;
1165 rndis_per_dev_params [i].ack = rndis_control_ack; 1165 rndis_per_dev_params [i].ack = rndis_control_ack;
1166 DEBUG("%s: configNr = %d\n", __FUNCTION__, i); 1166 DBG("%s: configNr = %d\n", __FUNCTION__, i);
1167 return i; 1167 return i;
1168 } 1168 }
1169 } 1169 }
1170 DEBUG("failed\n"); 1170 DBG("failed\n");
1171 1171
1172 return -1; 1172 return -1;
1173} 1173}
1174 1174
1175void rndis_deregister (int configNr) 1175void rndis_deregister (int configNr)
1176{ 1176{
1177 DEBUG("%s: \n", __FUNCTION__ ); 1177 DBG("%s: \n", __FUNCTION__ );
1178 1178
1179 if (configNr >= RNDIS_MAX_CONFIGS) return; 1179 if (configNr >= RNDIS_MAX_CONFIGS) return;
1180 rndis_per_dev_params [configNr].used = 0; 1180 rndis_per_dev_params [configNr].used = 0;
@@ -1186,7 +1186,7 @@ int rndis_set_param_dev (u8 configNr, struct net_device *dev,
1186 struct net_device_stats *stats, 1186 struct net_device_stats *stats,
1187 u16 *cdc_filter) 1187 u16 *cdc_filter)
1188{ 1188{
1189 DEBUG("%s:\n", __FUNCTION__ ); 1189 DBG("%s:\n", __FUNCTION__ );
1190 if (!dev || !stats) return -1; 1190 if (!dev || !stats) return -1;
1191 if (configNr >= RNDIS_MAX_CONFIGS) return -1; 1191 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1192 1192
@@ -1199,7 +1199,7 @@ int rndis_set_param_dev (u8 configNr, struct net_device *dev,
1199 1199
1200int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr) 1200int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)
1201{ 1201{
1202 DEBUG("%s:\n", __FUNCTION__ ); 1202 DBG("%s:\n", __FUNCTION__ );
1203 if (!vendorDescr) return -1; 1203 if (!vendorDescr) return -1;
1204 if (configNr >= RNDIS_MAX_CONFIGS) return -1; 1204 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1205 1205
@@ -1211,7 +1211,7 @@ int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)
1211 1211
1212int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed) 1212int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed)
1213{ 1213{
1214 DEBUG("%s: %u %u\n", __FUNCTION__, medium, speed); 1214 DBG("%s: %u %u\n", __FUNCTION__, medium, speed);
1215 if (configNr >= RNDIS_MAX_CONFIGS) return -1; 1215 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1216 1216
1217 rndis_per_dev_params [configNr].medium = medium; 1217 rndis_per_dev_params [configNr].medium = medium;
@@ -1390,7 +1390,7 @@ static int rndis_proc_write (struct file *file, const char __user *buffer,
1390 break; 1390 break;
1391 default: 1391 default:
1392 if (fl_speed) p->speed = speed; 1392 if (fl_speed) p->speed = speed;
1393 else DEBUG ("%c is not valid\n", c); 1393 else DBG("%c is not valid\n", c);
1394 break; 1394 break;
1395 } 1395 }
1396 1396
@@ -1419,12 +1419,12 @@ int __devinit rndis_init (void)
1419 if (!(rndis_connect_state [i] 1419 if (!(rndis_connect_state [i]
1420 = create_proc_entry (name, 0660, NULL))) 1420 = create_proc_entry (name, 0660, NULL)))
1421 { 1421 {
1422 DEBUG ("%s :remove entries", __FUNCTION__); 1422 DBG("%s :remove entries", __FUNCTION__);
1423 while (i) { 1423 while (i) {
1424 sprintf (name, NAME_TEMPLATE, --i); 1424 sprintf (name, NAME_TEMPLATE, --i);
1425 remove_proc_entry (name, NULL); 1425 remove_proc_entry (name, NULL);
1426 } 1426 }
1427 DEBUG ("\n"); 1427 DBG("\n");
1428 return -EIO; 1428 return -EIO;
1429 } 1429 }
1430 1430