Commit 70790f63 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c67ab134
...@@ -42,6 +42,20 @@ config USB_GADGET ...@@ -42,6 +42,20 @@ config USB_GADGET
For more information, see <http://www.linux-usb.org/gadget> and For more information, see <http://www.linux-usb.org/gadget> and
the kernel DocBook documentation for this API. the kernel DocBook documentation for this API.
config USB_GADGET_DEBUG
boolean "Debugging messages"
depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
help
Many controller and gadget drivers will print some debugging
messages if you use this option to ask for those messages.
Avoid enabling these messages, even if you're actively
debugging such a driver. Many drivers will emit so many
messages that the driver timings are affected, which will
either create new failure modes or remove the one you're
trying to track down. Never enable these messages for a
production build.
config USB_GADGET_DEBUG_FILES config USB_GADGET_DEBUG_FILES
boolean "Debugging information files" boolean "Debugging information files"
depends on USB_GADGET && PROC_FS depends on USB_GADGET && PROC_FS
......
# #
# USB peripheral controller drivers # USB peripheral controller drivers
# #
ifeq ($(CONFIG_USB_GADGET_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o
obj-$(CONFIG_USB_NET2280) += net2280.o obj-$(CONFIG_USB_NET2280) += net2280.o
obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
*/ */
#if 0 #if 0
#define DEBUG(str,args...) do { \ #define DBG(str,args...) do { \
if (rndis_debug) \ if (rndis_debug) \
printk(KERN_DEBUG str , ## args ); \ printk(KERN_DEBUG str , ## args ); \
} while (0) } while (0)
...@@ -65,7 +65,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging"); ...@@ -65,7 +65,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
#else #else
#define rndis_debug 0 #define rndis_debug 0
#define DEBUG(str,args...) do{}while(0) #define DBG(str,args...) do{}while(0)
#endif #endif
#define RNDIS_MAX_CONFIGS 1 #define RNDIS_MAX_CONFIGS 1
...@@ -183,9 +183,9 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -183,9 +183,9 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
if (!resp) return -ENOMEM; if (!resp) return -ENOMEM;
if (buf_len && rndis_debug > 1) { if (buf_len && rndis_debug > 1) {
DEBUG("query OID %08x value, len %d:\n", OID, buf_len); DBG("query OID %08x value, len %d:\n", OID, buf_len);
for (i = 0; i < buf_len; i += 16) { for (i = 0; i < buf_len; i += 16) {
DEBUG ("%03d: %08x %08x %08x %08x\n", i, DBG("%03d: %08x %08x %08x %08x\n", i,
le32_to_cpu(get_unaligned((__le32 *) le32_to_cpu(get_unaligned((__le32 *)
&buf[i])), &buf[i])),
le32_to_cpu(get_unaligned((__le32 *) le32_to_cpu(get_unaligned((__le32 *)
...@@ -207,7 +207,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -207,7 +207,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_SUPPORTED_LIST: case OID_GEN_SUPPORTED_LIST:
DEBUG ("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__); DBG("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__);
length = sizeof (oid_supported_list); length = sizeof (oid_supported_list);
count = length / sizeof (u32); count = length / sizeof (u32);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
...@@ -217,7 +217,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -217,7 +217,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_HARDWARE_STATUS: case OID_GEN_HARDWARE_STATUS:
DEBUG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__); DBG("%s: OID_GEN_HARDWARE_STATUS\n", __FUNCTION__);
/* Bogus question! /* Bogus question!
* Hardware must be ready to receive high level protocols. * Hardware must be ready to receive high level protocols.
* BTW: * BTW:
...@@ -230,14 +230,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -230,14 +230,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_MEDIA_SUPPORTED: case OID_GEN_MEDIA_SUPPORTED:
DEBUG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__); DBG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__);
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
retval = 0; retval = 0;
break; break;
/* mandatory */ /* mandatory */
case OID_GEN_MEDIA_IN_USE: case OID_GEN_MEDIA_IN_USE:
DEBUG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__); DBG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__);
/* one medium, one transport... (maybe you do it better) */ /* one medium, one transport... (maybe you do it better) */
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium); *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
retval = 0; retval = 0;
...@@ -245,7 +245,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -245,7 +245,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_MAXIMUM_FRAME_SIZE: case OID_GEN_MAXIMUM_FRAME_SIZE:
DEBUG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__); DBG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].dev) { if (rndis_per_dev_params [configNr].dev) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].dev->mtu); 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,7 +256,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_LINK_SPEED: case OID_GEN_LINK_SPEED:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_LINK_SPEED\n", __FUNCTION__); DBG("%s: OID_GEN_LINK_SPEED\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].media_state if (rndis_per_dev_params [configNr].media_state
== NDIS_MEDIA_STATE_DISCONNECTED) == NDIS_MEDIA_STATE_DISCONNECTED)
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
...@@ -268,7 +268,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -268,7 +268,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_TRANSMIT_BLOCK_SIZE: case OID_GEN_TRANSMIT_BLOCK_SIZE:
DEBUG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __FUNCTION__); DBG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].dev) { if (rndis_per_dev_params [configNr].dev) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].dev->mtu); 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,7 +278,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_RECEIVE_BLOCK_SIZE: case OID_GEN_RECEIVE_BLOCK_SIZE:
DEBUG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__); DBG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].dev) { if (rndis_per_dev_params [configNr].dev) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].dev->mtu); 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,7 +288,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_VENDOR_ID: case OID_GEN_VENDOR_ID:
DEBUG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__); DBG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__);
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].vendorID); rndis_per_dev_params [configNr].vendorID);
retval = 0; retval = 0;
...@@ -296,7 +296,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -296,7 +296,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_VENDOR_DESCRIPTION: case OID_GEN_VENDOR_DESCRIPTION:
DEBUG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __FUNCTION__); DBG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __FUNCTION__);
length = strlen (rndis_per_dev_params [configNr].vendorDescr); length = strlen (rndis_per_dev_params [configNr].vendorDescr);
memcpy (outbuf, memcpy (outbuf,
rndis_per_dev_params [configNr].vendorDescr, length); 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,7 +304,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_VENDOR_DRIVER_VERSION: case OID_GEN_VENDOR_DRIVER_VERSION:
DEBUG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__); DBG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__);
/* Created as LE */ /* Created as LE */
*outbuf = rndis_driver_version; *outbuf = rndis_driver_version;
retval = 0; retval = 0;
...@@ -312,14 +312,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -312,14 +312,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_CURRENT_PACKET_FILTER: case OID_GEN_CURRENT_PACKET_FILTER:
DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__); DBG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__);
*outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter); *outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter);
retval = 0; retval = 0;
break; break;
/* mandatory */ /* mandatory */
case OID_GEN_MAXIMUM_TOTAL_SIZE: case OID_GEN_MAXIMUM_TOTAL_SIZE:
DEBUG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __FUNCTION__); DBG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE); *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
retval = 0; retval = 0;
break; break;
...@@ -327,14 +327,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -327,14 +327,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_MEDIA_CONNECT_STATUS: case OID_GEN_MEDIA_CONNECT_STATUS:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __FUNCTION__); DBG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __FUNCTION__);
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.media_state); .media_state);
retval = 0; retval = 0;
break; break;
case OID_GEN_PHYSICAL_MEDIUM: case OID_GEN_PHYSICAL_MEDIUM:
DEBUG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__); DBG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
...@@ -344,7 +344,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -344,7 +344,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
* versions emit undefined RNDIS messages. DOCUMENT ALL THESE! * versions emit undefined RNDIS messages. DOCUMENT ALL THESE!
*/ */
case OID_GEN_MAC_OPTIONS: /* from WinME */ case OID_GEN_MAC_OPTIONS: /* from WinME */
DEBUG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__); DBG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32( *outbuf = __constant_cpu_to_le32(
NDIS_MAC_OPTION_RECEIVE_SERIALIZED NDIS_MAC_OPTION_RECEIVE_SERIALIZED
| NDIS_MAC_OPTION_FULL_DUPLEX); | NDIS_MAC_OPTION_FULL_DUPLEX);
...@@ -356,7 +356,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -356,7 +356,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_XMIT_OK: case OID_GEN_XMIT_OK:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__); DBG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].stats->tx_packets - 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,7 +369,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_RCV_OK: case OID_GEN_RCV_OK:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_RCV_OK\n", __FUNCTION__); DBG("%s: OID_GEN_RCV_OK\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].stats->rx_packets - 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,7 +382,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_XMIT_ERROR: case OID_GEN_XMIT_ERROR:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_XMIT_ERROR\n", __FUNCTION__); DBG("%s: OID_GEN_XMIT_ERROR\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->tx_errors); .stats->tx_errors);
...@@ -393,7 +393,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -393,7 +393,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_RCV_ERROR: case OID_GEN_RCV_ERROR:
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: OID_GEN_RCV_ERROR\n", __FUNCTION__); DBG("%s: OID_GEN_RCV_ERROR\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_errors); .stats->rx_errors);
...@@ -403,7 +403,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -403,7 +403,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_GEN_RCV_NO_BUFFER: case OID_GEN_RCV_NO_BUFFER:
DEBUG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__); DBG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_dropped); .stats->rx_dropped);
...@@ -413,7 +413,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -413,7 +413,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
#ifdef RNDIS_OPTIONAL_STATS #ifdef RNDIS_OPTIONAL_STATS
case OID_GEN_DIRECTED_BYTES_XMIT: case OID_GEN_DIRECTED_BYTES_XMIT:
DEBUG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__);
/* /*
* Aunt Tilly's size of shoes * Aunt Tilly's size of shoes
* minus antarctica count of penguins * minus antarctica count of penguins
...@@ -433,7 +433,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -433,7 +433,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_DIRECTED_FRAMES_XMIT: case OID_GEN_DIRECTED_FRAMES_XMIT:
DEBUG("%s: OID_GEN_DIRECTED_FRAMES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_DIRECTED_FRAMES_XMIT\n", __FUNCTION__);
/* dito */ /* dito */
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 ( *outbuf = cpu_to_le32 (
...@@ -449,7 +449,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -449,7 +449,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_MULTICAST_BYTES_XMIT: case OID_GEN_MULTICAST_BYTES_XMIT:
DEBUG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->multicast*1234); .stats->multicast*1234);
...@@ -458,7 +458,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -458,7 +458,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_MULTICAST_FRAMES_XMIT: case OID_GEN_MULTICAST_FRAMES_XMIT:
DEBUG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->multicast); .stats->multicast);
...@@ -467,7 +467,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -467,7 +467,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_BROADCAST_BYTES_XMIT: case OID_GEN_BROADCAST_BYTES_XMIT:
DEBUG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->tx_packets/42*255); .stats->tx_packets/42*255);
...@@ -476,7 +476,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -476,7 +476,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_BROADCAST_FRAMES_XMIT: case OID_GEN_BROADCAST_FRAMES_XMIT:
DEBUG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__); DBG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->tx_packets/42); .stats->tx_packets/42);
...@@ -485,19 +485,19 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -485,19 +485,19 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_DIRECTED_BYTES_RCV: case OID_GEN_DIRECTED_BYTES_RCV:
DEBUG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
case OID_GEN_DIRECTED_FRAMES_RCV: case OID_GEN_DIRECTED_FRAMES_RCV:
DEBUG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
case OID_GEN_MULTICAST_BYTES_RCV: case OID_GEN_MULTICAST_BYTES_RCV:
DEBUG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->multicast * 1111); .stats->multicast * 1111);
...@@ -506,7 +506,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -506,7 +506,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_MULTICAST_FRAMES_RCV: case OID_GEN_MULTICAST_FRAMES_RCV:
DEBUG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->multicast); .stats->multicast);
...@@ -515,7 +515,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -515,7 +515,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_BROADCAST_BYTES_RCV: case OID_GEN_BROADCAST_BYTES_RCV:
DEBUG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_packets/42*255); .stats->rx_packets/42*255);
...@@ -524,7 +524,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -524,7 +524,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_BROADCAST_FRAMES_RCV: case OID_GEN_BROADCAST_FRAMES_RCV:
DEBUG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__); DBG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_packets/42); .stats->rx_packets/42);
...@@ -533,7 +533,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -533,7 +533,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_RCV_CRC_ERROR: case OID_GEN_RCV_CRC_ERROR:
DEBUG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__); DBG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_crc_errors); .stats->rx_crc_errors);
...@@ -542,7 +542,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -542,7 +542,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
break; break;
case OID_GEN_TRANSMIT_QUEUE_LENGTH: case OID_GEN_TRANSMIT_QUEUE_LENGTH:
DEBUG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__); DBG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
...@@ -552,7 +552,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -552,7 +552,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_802_3_PERMANENT_ADDRESS: case OID_802_3_PERMANENT_ADDRESS:
DEBUG("%s: OID_802_3_PERMANENT_ADDRESS\n", __FUNCTION__); DBG("%s: OID_802_3_PERMANENT_ADDRESS\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].dev) { if (rndis_per_dev_params [configNr].dev) {
length = ETH_ALEN; length = ETH_ALEN;
memcpy (outbuf, memcpy (outbuf,
...@@ -564,7 +564,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -564,7 +564,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_802_3_CURRENT_ADDRESS: case OID_802_3_CURRENT_ADDRESS:
DEBUG("%s: OID_802_3_CURRENT_ADDRESS\n", __FUNCTION__); DBG("%s: OID_802_3_CURRENT_ADDRESS\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].dev) { if (rndis_per_dev_params [configNr].dev) {
length = ETH_ALEN; length = ETH_ALEN;
memcpy (outbuf, memcpy (outbuf,
...@@ -576,7 +576,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -576,7 +576,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_802_3_MULTICAST_LIST: case OID_802_3_MULTICAST_LIST:
DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); DBG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
/* Multicast base address only */ /* Multicast base address only */
*outbuf = __constant_cpu_to_le32 (0xE0000000); *outbuf = __constant_cpu_to_le32 (0xE0000000);
retval = 0; retval = 0;
...@@ -584,21 +584,21 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -584,21 +584,21 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_802_3_MAXIMUM_LIST_SIZE: case OID_802_3_MAXIMUM_LIST_SIZE:
DEBUG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__); DBG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__);
/* Multicast base address only */ /* Multicast base address only */
*outbuf = __constant_cpu_to_le32 (1); *outbuf = __constant_cpu_to_le32 (1);
retval = 0; retval = 0;
break; break;
case OID_802_3_MAC_OPTIONS: case OID_802_3_MAC_OPTIONS:
DEBUG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__); DBG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__);
break; break;
/* ieee802.3 statistics OIDs (table 4-4) */ /* ieee802.3 statistics OIDs (table 4-4) */
/* mandatory */ /* mandatory */
case OID_802_3_RCV_ERROR_ALIGNMENT: case OID_802_3_RCV_ERROR_ALIGNMENT:
DEBUG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __FUNCTION__); DBG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __FUNCTION__);
if (rndis_per_dev_params [configNr].stats) { if (rndis_per_dev_params [configNr].stats) {
*outbuf = cpu_to_le32 (rndis_per_dev_params [configNr] *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
.stats->rx_frame_errors); .stats->rx_frame_errors);
...@@ -608,51 +608,51 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -608,51 +608,51 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */ /* mandatory */
case OID_802_3_XMIT_ONE_COLLISION: case OID_802_3_XMIT_ONE_COLLISION:
DEBUG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
/* mandatory */ /* mandatory */
case OID_802_3_XMIT_MORE_COLLISIONS: case OID_802_3_XMIT_MORE_COLLISIONS:
DEBUG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__);
*outbuf = __constant_cpu_to_le32 (0); *outbuf = __constant_cpu_to_le32 (0);
retval = 0; retval = 0;
break; break;
#ifdef RNDIS_OPTIONAL_STATS #ifdef RNDIS_OPTIONAL_STATS
case OID_802_3_XMIT_DEFERRED: case OID_802_3_XMIT_DEFERRED:
DEBUG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_XMIT_MAX_COLLISIONS: case OID_802_3_XMIT_MAX_COLLISIONS:
DEBUG("%s: OID_802_3_XMIT_MAX_COLLISIONS\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_MAX_COLLISIONS\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_RCV_OVERRUN: case OID_802_3_RCV_OVERRUN:
DEBUG("%s: OID_802_3_RCV_OVERRUN\n", __FUNCTION__); DBG("%s: OID_802_3_RCV_OVERRUN\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_XMIT_UNDERRUN: case OID_802_3_XMIT_UNDERRUN:
DEBUG("%s: OID_802_3_XMIT_UNDERRUN\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_UNDERRUN\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_XMIT_HEARTBEAT_FAILURE: case OID_802_3_XMIT_HEARTBEAT_FAILURE:
DEBUG("%s: OID_802_3_XMIT_HEARTBEAT_FAILURE\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_HEARTBEAT_FAILURE\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_XMIT_TIMES_CRS_LOST: case OID_802_3_XMIT_TIMES_CRS_LOST:
DEBUG("%s: OID_802_3_XMIT_TIMES_CRS_LOST\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_TIMES_CRS_LOST\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
case OID_802_3_XMIT_LATE_COLLISIONS: case OID_802_3_XMIT_LATE_COLLISIONS:
DEBUG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__); DBG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__);
/* TODO */ /* TODO */
break; break;
#endif /* RNDIS_OPTIONAL_STATS */ #endif /* RNDIS_OPTIONAL_STATS */
...@@ -660,7 +660,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -660,7 +660,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
#ifdef RNDIS_PM #ifdef RNDIS_PM
/* power management OIDs (table 4-5) */ /* power management OIDs (table 4-5) */
case OID_PNP_CAPABILITIES: case OID_PNP_CAPABILITIES:
DEBUG("%s: OID_PNP_CAPABILITIES\n", __FUNCTION__); DBG("%s: OID_PNP_CAPABILITIES\n", __FUNCTION__);
/* for now, no wakeup capabilities */ /* for now, no wakeup capabilities */
length = sizeof (struct NDIS_PNP_CAPABILITIES); length = sizeof (struct NDIS_PNP_CAPABILITIES);
...@@ -668,7 +668,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, ...@@ -668,7 +668,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
retval = 0; retval = 0;
break; break;
case OID_PNP_QUERY_POWER: case OID_PNP_QUERY_POWER:
DEBUG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__, DBG("%s: OID_PNP_QUERY_POWER D%d\n", __FUNCTION__,
le32_to_cpu(get_unaligned((__le32 *)buf)) - 1); le32_to_cpu(get_unaligned((__le32 *)buf)) - 1);
/* only suspend is a real power state, and /* only suspend is a real power state, and
* it can't be entered by OID_PNP_SET_POWER... * 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,9 +705,9 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
return -ENOMEM; return -ENOMEM;
if (buf_len && rndis_debug > 1) { if (buf_len && rndis_debug > 1) {
DEBUG("set OID %08x value, len %d:\n", OID, buf_len); DBG("set OID %08x value, len %d:\n", OID, buf_len);
for (i = 0; i < buf_len; i += 16) { for (i = 0; i < buf_len; i += 16) {
DEBUG ("%03d: %08x %08x %08x %08x\n", i, DBG("%03d: %08x %08x %08x %08x\n", i,
le32_to_cpu(get_unaligned((__le32 *) le32_to_cpu(get_unaligned((__le32 *)
&buf[i])), &buf[i])),
le32_to_cpu(get_unaligned((__le32 *) 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,7 +731,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
*/ */
*params->filter = (u16) le32_to_cpu(get_unaligned( *params->filter = (u16) le32_to_cpu(get_unaligned(
(__le32 *)buf)); (__le32 *)buf));
DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n", DBG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
__FUNCTION__, *params->filter); __FUNCTION__, *params->filter);
/* this call has a significant side effect: it's /* this call has a significant side effect: it's
...@@ -756,7 +756,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, ...@@ -756,7 +756,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
case OID_802_3_MULTICAST_LIST: case OID_802_3_MULTICAST_LIST:
/* I think we can ignore this */ /* I think we can ignore this */
DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__); DBG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
retval = 0; retval = 0;
break; break;
#if 0 #if 0
...@@ -764,7 +764,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, ...@@ -764,7 +764,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
{ {
struct rndis_config_parameter *param; struct rndis_config_parameter *param;
param = (struct rndis_config_parameter *) buf; param = (struct rndis_config_parameter *) buf;
DEBUG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER '%*s'\n", DBG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER '%*s'\n",
__FUNCTION__, __FUNCTION__,
min(cpu_to_le32(param->ParameterNameLength),80), min(cpu_to_le32(param->ParameterNameLength),80),
buf + param->ParameterNameOffset); buf + param->ParameterNameOffset);
...@@ -781,7 +781,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len, ...@@ -781,7 +781,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
* FIXME ... then things go batty; Windows wedges itself. * FIXME ... then things go batty; Windows wedges itself.
*/ */
i = le32_to_cpu(get_unaligned((__le32 *)buf)); i = le32_to_cpu(get_unaligned((__le32 *)buf));
DEBUG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1); DBG("%s: OID_PNP_SET_POWER D%d\n", __FUNCTION__, i - 1);
switch (i) { switch (i) {
case NdisDeviceStateD0: case NdisDeviceStateD0:
*params->filter = params->saved_filter; *params->filter = params->saved_filter;
...@@ -858,7 +858,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf) ...@@ -858,7 +858,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
rndis_query_cmplt_type *resp; rndis_query_cmplt_type *resp;
rndis_resp_t *r; rndis_resp_t *r;
// DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); // DBG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID));
if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
/* /*
...@@ -911,15 +911,15 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf) ...@@ -911,15 +911,15 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
BufOffset = le32_to_cpu (buf->InformationBufferOffset); BufOffset = le32_to_cpu (buf->InformationBufferOffset);
#ifdef VERBOSE #ifdef VERBOSE
DEBUG("%s: Length: %d\n", __FUNCTION__, BufLength); DBG("%s: Length: %d\n", __FUNCTION__, BufLength);
DEBUG("%s: Offset: %d\n", __FUNCTION__, BufOffset); DBG("%s: Offset: %d\n", __FUNCTION__, BufOffset);
DEBUG("%s: InfoBuffer: ", __FUNCTION__); DBG("%s: InfoBuffer: ", __FUNCTION__);
for (i = 0; i < BufLength; i++) { for (i = 0; i < BufLength; i++) {
DEBUG ("%02x ", *(((u8 *) buf) + i + 8 + BufOffset)); DBG("%02x ", *(((u8 *) buf) + i + 8 + BufOffset));
} }
DEBUG ("\n"); DBG("\n");
#endif #endif
resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT); resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
...@@ -1082,14 +1082,14 @@ int rndis_msg_parser (u8 configNr, u8 *buf) ...@@ -1082,14 +1082,14 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
/* For USB: responses may take up to 10 seconds */ /* For USB: responses may take up to 10 seconds */
switch (MsgType) { switch (MsgType) {
case REMOTE_NDIS_INITIALIZE_MSG: case REMOTE_NDIS_INITIALIZE_MSG:
DEBUG("%s: REMOTE_NDIS_INITIALIZE_MSG\n", DBG("%s: REMOTE_NDIS_INITIALIZE_MSG\n",
__FUNCTION__ ); __FUNCTION__ );
params->state = RNDIS_INITIALIZED; params->state = RNDIS_INITIALIZED;
return rndis_init_response (configNr, return rndis_init_response (configNr,
(rndis_init_msg_type *) buf); (rndis_init_msg_type *) buf);
case REMOTE_NDIS_HALT_MSG: case REMOTE_NDIS_HALT_MSG:
DEBUG("%s: REMOTE_NDIS_HALT_MSG\n", DBG("%s: REMOTE_NDIS_HALT_MSG\n",
__FUNCTION__ ); __FUNCTION__ );
params->state = RNDIS_UNINITIALIZED; params->state = RNDIS_UNINITIALIZED;
if (params->dev) { if (params->dev) {
...@@ -1107,7 +1107,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf) ...@@ -1107,7 +1107,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
(rndis_set_msg_type *) buf); (rndis_set_msg_type *) buf);
case REMOTE_NDIS_RESET_MSG: case REMOTE_NDIS_RESET_MSG:
DEBUG("%s: REMOTE_NDIS_RESET_MSG\n", DBG("%s: REMOTE_NDIS_RESET_MSG\n",
__FUNCTION__ ); __FUNCTION__ );
return rndis_reset_response (configNr, return rndis_reset_response (configNr,
(rndis_reset_msg_type *) buf); (rndis_reset_msg_type *) buf);
...@@ -1115,7 +1115,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf) ...@@ -1115,7 +1115,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
case REMOTE_NDIS_KEEPALIVE_MSG: case REMOTE_NDIS_KEEPALIVE_MSG:
/* For USB: host does this every 5 seconds */ /* For USB: host does this every 5 seconds */
if (rndis_debug > 1) if (rndis_debug > 1)
DEBUG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n", DBG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n",
__FUNCTION__ ); __FUNCTION__ );
return rndis_keepalive_response (configNr, return rndis_keepalive_response (configNr,
(rndis_keepalive_msg_type *) (rndis_keepalive_msg_type *)
...@@ -1132,7 +1132,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf) ...@@ -1132,7 +1132,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
{ {
unsigned i; unsigned i;
for (i = 0; i < MsgLength; i += 16) { for (i = 0; i < MsgLength; i += 16) {
DEBUG ("%03d: " DBG("%03d: "
" %02x %02x %02x %02x" " %02x %02x %02x %02x"
" %02x %02x %02x %02x" " %02x %02x %02x %02x"
" %02x %02x %02x %02x" " %02x %02x %02x %02x"
...@@ -1163,18 +1163,18 @@ int rndis_register (int (* rndis_control_ack) (struct net_device *)) ...@@ -1163,18 +1163,18 @@ int rndis_register (int (* rndis_control_ack) (struct net_device *))
if (!rndis_per_dev_params [i].used) { if (!rndis_per_dev_params [i].used) {
rndis_per_dev_params [i].used = 1; rndis_per_dev_params [i].used = 1;
rndis_per_dev_params [i].ack = rndis_control_ack; rndis_per_dev_params [i].ack = rndis_control_ack;
DEBUG("%s: configNr = %d\n", __FUNCTION__, i); DBG("%s: configNr = %d\n", __FUNCTION__, i);
return i; return i;
} }
} }
DEBUG("failed\n"); DBG("failed\n");
return -1; return -1;
} }
void rndis_deregister (int configNr) void rndis_deregister (int configNr)
{ {
DEBUG("%s: \n", __FUNCTION__ ); DBG("%s: \n", __FUNCTION__ );
if (configNr >= RNDIS_MAX_CONFIGS) return; if (configNr >= RNDIS_MAX_CONFIGS) return;
rndis_per_dev_params [configNr].used = 0; rndis_per_dev_params [configNr].used = 0;
...@@ -1186,7 +1186,7 @@ int rndis_set_param_dev (u8 configNr, struct net_device *dev, ...@@ -1186,7 +1186,7 @@ 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)
{ {
DEBUG("%s:\n", __FUNCTION__ ); DBG("%s:\n", __FUNCTION__ );
if (!dev || !stats) return -1; if (!dev || !stats) return -1;
if (configNr >= RNDIS_MAX_CONFIGS) return -1; if (configNr >= RNDIS_MAX_CONFIGS) return -1;
...@@ -1199,7 +1199,7 @@ int rndis_set_param_dev (u8 configNr, struct net_device *dev, ...@@ -1199,7 +1199,7 @@ int rndis_set_param_dev (u8 configNr, struct net_device *dev,
int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr) int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)
{ {
DEBUG("%s:\n", __FUNCTION__ ); DBG("%s:\n", __FUNCTION__ );
if (!vendorDescr) return -1; if (!vendorDescr) return -1;
if (configNr >= RNDIS_MAX_CONFIGS) return -1; if (configNr >= RNDIS_MAX_CONFIGS) return -1;
...@@ -1211,7 +1211,7 @@ int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr) ...@@ -1211,7 +1211,7 @@ int rndis_set_param_vendor (u8 configNr, u32 vendorID, 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)
{ {
DEBUG("%s: %u %u\n", __FUNCTION__, medium, speed); DBG("%s: %u %u\n", __FUNCTION__, medium, speed);
if (configNr >= RNDIS_MAX_CONFIGS) return -1; if (configNr >= RNDIS_MAX_CONFIGS) return -1;
rndis_per_dev_params [configNr].medium = medium; rndis_per_dev_params [configNr].medium = medium;
...@@ -1390,7 +1390,7 @@ static int rndis_proc_write (struct file *file, const char __user *buffer, ...@@ -1390,7 +1390,7 @@ static int rndis_proc_write (struct file *file, const char __user *buffer,
break; break;
default: default:
if (fl_speed) p->speed = speed; if (fl_speed) p->speed = speed;
else DEBUG ("%c is not valid\n", c); else DBG("%c is not valid\n", c);
break; break;
} }
...@@ -1419,12 +1419,12 @@ int __devinit rndis_init (void) ...@@ -1419,12 +1419,12 @@ int __devinit rndis_init (void)
if (!(rndis_connect_state [i] if (!(rndis_connect_state [i]
= create_proc_entry (name, 0660, NULL))) = create_proc_entry (name, 0660, NULL)))
{ {
DEBUG ("%s :remove entries", __FUNCTION__); DBG("%s :remove entries", __FUNCTION__);
while (i) { while (i) {
sprintf (name, NAME_TEMPLATE, --i); sprintf (name, NAME_TEMPLATE, --i);
remove_proc_entry (name, NULL); remove_proc_entry (name, NULL);
} }
DEBUG ("\n"); DBG("\n");
return -EIO; return -EIO;
} }
......
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