diff options
author | Oliver Neukum <oliver@neukum.name> | 2006-09-28 17:36:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-17 17:46:30 -0400 |
commit | fbe2bafcb00b25265c2c869ba4615d6a5324b7f1 (patch) | |
tree | 33524d8878fbb57b16930cd998771916f377d54d /drivers/usb | |
parent | 91a9c9214e34c364bf15406aadb922787ae7129b (diff) |
USB: remove private debug macros from kaweth
this kills the private debug macros from the kaweth driver.
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/net/kaweth.c | 122 |
1 files changed, 56 insertions, 66 deletions
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c index 957d4ad316f9..9ef9075a1680 100644 --- a/drivers/usb/net/kaweth.c +++ b/drivers/usb/net/kaweth.c | |||
@@ -65,16 +65,6 @@ | |||
65 | 65 | ||
66 | #undef DEBUG | 66 | #undef DEBUG |
67 | 67 | ||
68 | #ifdef DEBUG | ||
69 | #define kaweth_dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" ,##arg) | ||
70 | #else | ||
71 | #define kaweth_dbg(format, arg...) do {} while (0) | ||
72 | #endif | ||
73 | #define kaweth_err(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" ,##arg) | ||
74 | #define kaweth_info(format, arg...) printk(KERN_INFO __FILE__ ": " format "\n" , ##arg) | ||
75 | #define kaweth_warn(format, arg...) printk(KERN_WARNING __FILE__ ": " format "\n" , ##arg) | ||
76 | |||
77 | |||
78 | #include "kawethfw.h" | 68 | #include "kawethfw.h" |
79 | 69 | ||
80 | #define KAWETH_MTU 1514 | 70 | #define KAWETH_MTU 1514 |
@@ -265,17 +255,17 @@ static int kaweth_control(struct kaweth_device *kaweth, | |||
265 | { | 255 | { |
266 | struct usb_ctrlrequest *dr; | 256 | struct usb_ctrlrequest *dr; |
267 | 257 | ||
268 | kaweth_dbg("kaweth_control()"); | 258 | dbg("kaweth_control()"); |
269 | 259 | ||
270 | if(in_interrupt()) { | 260 | if(in_interrupt()) { |
271 | kaweth_dbg("in_interrupt()"); | 261 | dbg("in_interrupt()"); |
272 | return -EBUSY; | 262 | return -EBUSY; |
273 | } | 263 | } |
274 | 264 | ||
275 | dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); | 265 | dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); |
276 | 266 | ||
277 | if (!dr) { | 267 | if (!dr) { |
278 | kaweth_dbg("kmalloc() failed"); | 268 | dbg("kmalloc() failed"); |
279 | return -ENOMEM; | 269 | return -ENOMEM; |
280 | } | 270 | } |
281 | 271 | ||
@@ -300,7 +290,7 @@ static int kaweth_read_configuration(struct kaweth_device *kaweth) | |||
300 | { | 290 | { |
301 | int retval; | 291 | int retval; |
302 | 292 | ||
303 | kaweth_dbg("Reading kaweth configuration"); | 293 | dbg("Reading kaweth configuration"); |
304 | 294 | ||
305 | retval = kaweth_control(kaweth, | 295 | retval = kaweth_control(kaweth, |
306 | usb_rcvctrlpipe(kaweth->dev, 0), | 296 | usb_rcvctrlpipe(kaweth->dev, 0), |
@@ -322,7 +312,7 @@ static int kaweth_set_urb_size(struct kaweth_device *kaweth, __u16 urb_size) | |||
322 | { | 312 | { |
323 | int retval; | 313 | int retval; |
324 | 314 | ||
325 | kaweth_dbg("Setting URB size to %d", (unsigned)urb_size); | 315 | dbg("Setting URB size to %d", (unsigned)urb_size); |
326 | 316 | ||
327 | retval = kaweth_control(kaweth, | 317 | retval = kaweth_control(kaweth, |
328 | usb_sndctrlpipe(kaweth->dev, 0), | 318 | usb_sndctrlpipe(kaweth->dev, 0), |
@@ -344,7 +334,7 @@ static int kaweth_set_sofs_wait(struct kaweth_device *kaweth, __u16 sofs_wait) | |||
344 | { | 334 | { |
345 | int retval; | 335 | int retval; |
346 | 336 | ||
347 | kaweth_dbg("Set SOFS wait to %d", (unsigned)sofs_wait); | 337 | dbg("Set SOFS wait to %d", (unsigned)sofs_wait); |
348 | 338 | ||
349 | retval = kaweth_control(kaweth, | 339 | retval = kaweth_control(kaweth, |
350 | usb_sndctrlpipe(kaweth->dev, 0), | 340 | usb_sndctrlpipe(kaweth->dev, 0), |
@@ -367,7 +357,7 @@ static int kaweth_set_receive_filter(struct kaweth_device *kaweth, | |||
367 | { | 357 | { |
368 | int retval; | 358 | int retval; |
369 | 359 | ||
370 | kaweth_dbg("Set receive filter to %d", (unsigned)receive_filter); | 360 | dbg("Set receive filter to %d", (unsigned)receive_filter); |
371 | 361 | ||
372 | retval = kaweth_control(kaweth, | 362 | retval = kaweth_control(kaweth, |
373 | usb_sndctrlpipe(kaweth->dev, 0), | 363 | usb_sndctrlpipe(kaweth->dev, 0), |
@@ -392,7 +382,7 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth, | |||
392 | __u8 type) | 382 | __u8 type) |
393 | { | 383 | { |
394 | if(data_len > KAWETH_FIRMWARE_BUF_SIZE) { | 384 | if(data_len > KAWETH_FIRMWARE_BUF_SIZE) { |
395 | kaweth_err("Firmware too big: %d", data_len); | 385 | err("Firmware too big: %d", data_len); |
396 | return -ENOSPC; | 386 | return -ENOSPC; |
397 | } | 387 | } |
398 | 388 | ||
@@ -403,13 +393,13 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth, | |||
403 | kaweth->firmware_buf[4] = type; | 393 | kaweth->firmware_buf[4] = type; |
404 | kaweth->firmware_buf[5] = interrupt; | 394 | kaweth->firmware_buf[5] = interrupt; |
405 | 395 | ||
406 | kaweth_dbg("High: %i, Low:%i", kaweth->firmware_buf[3], | 396 | dbg("High: %i, Low:%i", kaweth->firmware_buf[3], |
407 | kaweth->firmware_buf[2]); | 397 | kaweth->firmware_buf[2]); |
408 | 398 | ||
409 | kaweth_dbg("Downloading firmware at %p to kaweth device at %p", | 399 | dbg("Downloading firmware at %p to kaweth device at %p", |
410 | data, | 400 | data, |
411 | kaweth); | 401 | kaweth); |
412 | kaweth_dbg("Firmware length: %d", data_len); | 402 | dbg("Firmware length: %d", data_len); |
413 | 403 | ||
414 | return kaweth_control(kaweth, | 404 | return kaweth_control(kaweth, |
415 | usb_sndctrlpipe(kaweth->dev, 0), | 405 | usb_sndctrlpipe(kaweth->dev, 0), |
@@ -437,7 +427,7 @@ static int kaweth_trigger_firmware(struct kaweth_device *kaweth, | |||
437 | kaweth->firmware_buf[6] = 0x00; | 427 | kaweth->firmware_buf[6] = 0x00; |
438 | kaweth->firmware_buf[7] = 0x00; | 428 | kaweth->firmware_buf[7] = 0x00; |
439 | 429 | ||
440 | kaweth_dbg("Triggering firmware"); | 430 | dbg("Triggering firmware"); |
441 | 431 | ||
442 | return kaweth_control(kaweth, | 432 | return kaweth_control(kaweth, |
443 | usb_sndctrlpipe(kaweth->dev, 0), | 433 | usb_sndctrlpipe(kaweth->dev, 0), |
@@ -457,7 +447,7 @@ static int kaweth_reset(struct kaweth_device *kaweth) | |||
457 | { | 447 | { |
458 | int result; | 448 | int result; |
459 | 449 | ||
460 | kaweth_dbg("kaweth_reset(%p)", kaweth); | 450 | dbg("kaweth_reset(%p)", kaweth); |
461 | result = kaweth_control(kaweth, | 451 | result = kaweth_control(kaweth, |
462 | usb_sndctrlpipe(kaweth->dev, 0), | 452 | usb_sndctrlpipe(kaweth->dev, 0), |
463 | USB_REQ_SET_CONFIGURATION, | 453 | USB_REQ_SET_CONFIGURATION, |
@@ -470,7 +460,7 @@ static int kaweth_reset(struct kaweth_device *kaweth) | |||
470 | 460 | ||
471 | mdelay(10); | 461 | mdelay(10); |
472 | 462 | ||
473 | kaweth_dbg("kaweth_reset() returns %d.",result); | 463 | dbg("kaweth_reset() returns %d.",result); |
474 | 464 | ||
475 | return result; | 465 | return result; |
476 | } | 466 | } |
@@ -568,7 +558,7 @@ static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth, | |||
568 | kaweth->suspend_lowmem_rx = 1; | 558 | kaweth->suspend_lowmem_rx = 1; |
569 | schedule_delayed_work(&kaweth->lowmem_work, HZ/4); | 559 | schedule_delayed_work(&kaweth->lowmem_work, HZ/4); |
570 | } | 560 | } |
571 | kaweth_err("resubmitting rx_urb %d failed", result); | 561 | err("resubmitting rx_urb %d failed", result); |
572 | } else { | 562 | } else { |
573 | kaweth->suspend_lowmem_rx = 0; | 563 | kaweth->suspend_lowmem_rx = 0; |
574 | } | 564 | } |
@@ -605,7 +595,7 @@ static void kaweth_usb_receive(struct urb *urb) | |||
605 | return; | 595 | return; |
606 | 596 | ||
607 | if(urb->status && urb->status != -EREMOTEIO && count != 1) { | 597 | if(urb->status && urb->status != -EREMOTEIO && count != 1) { |
608 | kaweth_err("%s RX status: %d count: %d packet_len: %d", | 598 | err("%s RX status: %d count: %d packet_len: %d", |
609 | net->name, | 599 | net->name, |
610 | urb->status, | 600 | urb->status, |
611 | count, | 601 | count, |
@@ -616,9 +606,9 @@ static void kaweth_usb_receive(struct urb *urb) | |||
616 | 606 | ||
617 | if(kaweth->net && (count > 2)) { | 607 | if(kaweth->net && (count > 2)) { |
618 | if(pkt_len > (count - 2)) { | 608 | if(pkt_len > (count - 2)) { |
619 | kaweth_err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count); | 609 | err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count); |
620 | kaweth_err("Packet len & 2047: %x", pkt_len & 2047); | 610 | err("Packet len & 2047: %x", pkt_len & 2047); |
621 | kaweth_err("Count 2: %x", count2); | 611 | err("Count 2: %x", count2); |
622 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); | 612 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); |
623 | return; | 613 | return; |
624 | } | 614 | } |
@@ -655,7 +645,7 @@ static int kaweth_open(struct net_device *net) | |||
655 | struct kaweth_device *kaweth = netdev_priv(net); | 645 | struct kaweth_device *kaweth = netdev_priv(net); |
656 | int res; | 646 | int res; |
657 | 647 | ||
658 | kaweth_dbg("Opening network device."); | 648 | dbg("Opening network device."); |
659 | 649 | ||
660 | res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); | 650 | res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); |
661 | if (res) | 651 | if (res) |
@@ -732,7 +722,7 @@ static void kaweth_usb_transmit_complete(struct urb *urb) | |||
732 | 722 | ||
733 | if (unlikely(urb->status != 0)) | 723 | if (unlikely(urb->status != 0)) |
734 | if (urb->status != -ENOENT) | 724 | if (urb->status != -ENOENT) |
735 | kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status); | 725 | dbg("%s: TX status %d.", kaweth->net->name, urb->status); |
736 | 726 | ||
737 | netif_wake_queue(kaweth->net); | 727 | netif_wake_queue(kaweth->net); |
738 | dev_kfree_skb_irq(skb); | 728 | dev_kfree_skb_irq(skb); |
@@ -783,7 +773,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
783 | 773 | ||
784 | if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC))) | 774 | if((res = usb_submit_urb(kaweth->tx_urb, GFP_ATOMIC))) |
785 | { | 775 | { |
786 | kaweth_warn("kaweth failed tx_urb %d", res); | 776 | warn("kaweth failed tx_urb %d", res); |
787 | kaweth->stats.tx_errors++; | 777 | kaweth->stats.tx_errors++; |
788 | 778 | ||
789 | netif_start_queue(net); | 779 | netif_start_queue(net); |
@@ -812,7 +802,7 @@ static void kaweth_set_rx_mode(struct net_device *net) | |||
812 | KAWETH_PACKET_FILTER_BROADCAST | | 802 | KAWETH_PACKET_FILTER_BROADCAST | |
813 | KAWETH_PACKET_FILTER_MULTICAST; | 803 | KAWETH_PACKET_FILTER_MULTICAST; |
814 | 804 | ||
815 | kaweth_dbg("Setting Rx mode to %d", packet_filter_bitmap); | 805 | dbg("Setting Rx mode to %d", packet_filter_bitmap); |
816 | 806 | ||
817 | netif_stop_queue(net); | 807 | netif_stop_queue(net); |
818 | 808 | ||
@@ -850,10 +840,10 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth) | |||
850 | KAWETH_CONTROL_TIMEOUT); | 840 | KAWETH_CONTROL_TIMEOUT); |
851 | 841 | ||
852 | if(result < 0) { | 842 | if(result < 0) { |
853 | kaweth_err("Failed to set Rx mode: %d", result); | 843 | err("Failed to set Rx mode: %d", result); |
854 | } | 844 | } |
855 | else { | 845 | else { |
856 | kaweth_dbg("Set Rx mode to %d", packet_filter_bitmap); | 846 | dbg("Set Rx mode to %d", packet_filter_bitmap); |
857 | } | 847 | } |
858 | } | 848 | } |
859 | } | 849 | } |
@@ -874,7 +864,7 @@ static void kaweth_tx_timeout(struct net_device *net) | |||
874 | { | 864 | { |
875 | struct kaweth_device *kaweth = netdev_priv(net); | 865 | struct kaweth_device *kaweth = netdev_priv(net); |
876 | 866 | ||
877 | kaweth_warn("%s: Tx timed out. Resetting.", net->name); | 867 | warn("%s: Tx timed out. Resetting.", net->name); |
878 | kaweth->stats.tx_errors++; | 868 | kaweth->stats.tx_errors++; |
879 | net->trans_start = jiffies; | 869 | net->trans_start = jiffies; |
880 | 870 | ||
@@ -895,15 +885,15 @@ static int kaweth_probe( | |||
895 | const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | 885 | const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
896 | int result = 0; | 886 | int result = 0; |
897 | 887 | ||
898 | kaweth_dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x", | 888 | dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x", |
899 | dev->devnum, | 889 | dev->devnum, |
900 | le16_to_cpu(dev->descriptor.idVendor), | 890 | le16_to_cpu(dev->descriptor.idVendor), |
901 | le16_to_cpu(dev->descriptor.idProduct), | 891 | le16_to_cpu(dev->descriptor.idProduct), |
902 | le16_to_cpu(dev->descriptor.bcdDevice)); | 892 | le16_to_cpu(dev->descriptor.bcdDevice)); |
903 | 893 | ||
904 | kaweth_dbg("Device at %p", dev); | 894 | dbg("Device at %p", dev); |
905 | 895 | ||
906 | kaweth_dbg("Descriptor length: %x type: %x", | 896 | dbg("Descriptor length: %x type: %x", |
907 | (int)dev->descriptor.bLength, | 897 | (int)dev->descriptor.bLength, |
908 | (int)dev->descriptor.bDescriptorType); | 898 | (int)dev->descriptor.bDescriptorType); |
909 | 899 | ||
@@ -918,7 +908,7 @@ static int kaweth_probe( | |||
918 | spin_lock_init(&kaweth->device_lock); | 908 | spin_lock_init(&kaweth->device_lock); |
919 | init_waitqueue_head(&kaweth->term_wait); | 909 | init_waitqueue_head(&kaweth->term_wait); |
920 | 910 | ||
921 | kaweth_dbg("Resetting."); | 911 | dbg("Resetting."); |
922 | 912 | ||
923 | kaweth_reset(kaweth); | 913 | kaweth_reset(kaweth); |
924 | 914 | ||
@@ -928,17 +918,17 @@ static int kaweth_probe( | |||
928 | */ | 918 | */ |
929 | 919 | ||
930 | if (le16_to_cpu(dev->descriptor.bcdDevice) >> 8) { | 920 | if (le16_to_cpu(dev->descriptor.bcdDevice) >> 8) { |
931 | kaweth_info("Firmware present in device."); | 921 | info("Firmware present in device."); |
932 | } else { | 922 | } else { |
933 | /* Download the firmware */ | 923 | /* Download the firmware */ |
934 | kaweth_info("Downloading firmware..."); | 924 | info("Downloading firmware..."); |
935 | kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); | 925 | kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); |
936 | if ((result = kaweth_download_firmware(kaweth, | 926 | if ((result = kaweth_download_firmware(kaweth, |
937 | kaweth_new_code, | 927 | kaweth_new_code, |
938 | len_kaweth_new_code, | 928 | len_kaweth_new_code, |
939 | 100, | 929 | 100, |
940 | 2)) < 0) { | 930 | 2)) < 0) { |
941 | kaweth_err("Error downloading firmware (%d)", result); | 931 | err("Error downloading firmware (%d)", result); |
942 | goto err_fw; | 932 | goto err_fw; |
943 | } | 933 | } |
944 | 934 | ||
@@ -947,7 +937,7 @@ static int kaweth_probe( | |||
947 | len_kaweth_new_code_fix, | 937 | len_kaweth_new_code_fix, |
948 | 100, | 938 | 100, |
949 | 3)) < 0) { | 939 | 3)) < 0) { |
950 | kaweth_err("Error downloading firmware fix (%d)", result); | 940 | err("Error downloading firmware fix (%d)", result); |
951 | goto err_fw; | 941 | goto err_fw; |
952 | } | 942 | } |
953 | 943 | ||
@@ -956,7 +946,7 @@ static int kaweth_probe( | |||
956 | len_kaweth_trigger_code, | 946 | len_kaweth_trigger_code, |
957 | 126, | 947 | 126, |
958 | 2)) < 0) { | 948 | 2)) < 0) { |
959 | kaweth_err("Error downloading trigger code (%d)", result); | 949 | err("Error downloading trigger code (%d)", result); |
960 | goto err_fw; | 950 | goto err_fw; |
961 | 951 | ||
962 | } | 952 | } |
@@ -966,18 +956,18 @@ static int kaweth_probe( | |||
966 | len_kaweth_trigger_code_fix, | 956 | len_kaweth_trigger_code_fix, |
967 | 126, | 957 | 126, |
968 | 3)) < 0) { | 958 | 3)) < 0) { |
969 | kaweth_err("Error downloading trigger code fix (%d)", result); | 959 | err("Error downloading trigger code fix (%d)", result); |
970 | goto err_fw; | 960 | goto err_fw; |
971 | } | 961 | } |
972 | 962 | ||
973 | 963 | ||
974 | if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { | 964 | if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { |
975 | kaweth_err("Error triggering firmware (%d)", result); | 965 | err("Error triggering firmware (%d)", result); |
976 | goto err_fw; | 966 | goto err_fw; |
977 | } | 967 | } |
978 | 968 | ||
979 | /* Device will now disappear for a moment... */ | 969 | /* Device will now disappear for a moment... */ |
980 | kaweth_info("Firmware loaded. I'll be back..."); | 970 | info("Firmware loaded. I'll be back..."); |
981 | err_fw: | 971 | err_fw: |
982 | free_page((unsigned long)kaweth->firmware_buf); | 972 | free_page((unsigned long)kaweth->firmware_buf); |
983 | free_netdev(netdev); | 973 | free_netdev(netdev); |
@@ -987,14 +977,14 @@ err_fw: | |||
987 | result = kaweth_read_configuration(kaweth); | 977 | result = kaweth_read_configuration(kaweth); |
988 | 978 | ||
989 | if(result < 0) { | 979 | if(result < 0) { |
990 | kaweth_err("Error reading configuration (%d), no net device created", result); | 980 | err("Error reading configuration (%d), no net device created", result); |
991 | goto err_free_netdev; | 981 | goto err_free_netdev; |
992 | } | 982 | } |
993 | 983 | ||
994 | kaweth_info("Statistics collection: %x", kaweth->configuration.statistics_mask); | 984 | info("Statistics collection: %x", kaweth->configuration.statistics_mask); |
995 | kaweth_info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1)); | 985 | info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1)); |
996 | kaweth_info("MTU: %d", le16_to_cpu(kaweth->configuration.segment_size)); | 986 | info("MTU: %d", le16_to_cpu(kaweth->configuration.segment_size)); |
997 | kaweth_info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", | 987 | info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", |
998 | (int)kaweth->configuration.hw_addr[0], | 988 | (int)kaweth->configuration.hw_addr[0], |
999 | (int)kaweth->configuration.hw_addr[1], | 989 | (int)kaweth->configuration.hw_addr[1], |
1000 | (int)kaweth->configuration.hw_addr[2], | 990 | (int)kaweth->configuration.hw_addr[2], |
@@ -1005,17 +995,17 @@ err_fw: | |||
1005 | if(!memcmp(&kaweth->configuration.hw_addr, | 995 | if(!memcmp(&kaweth->configuration.hw_addr, |
1006 | &bcast_addr, | 996 | &bcast_addr, |
1007 | sizeof(bcast_addr))) { | 997 | sizeof(bcast_addr))) { |
1008 | kaweth_err("Firmware not functioning properly, no net device created"); | 998 | err("Firmware not functioning properly, no net device created"); |
1009 | goto err_free_netdev; | 999 | goto err_free_netdev; |
1010 | } | 1000 | } |
1011 | 1001 | ||
1012 | if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) { | 1002 | if(kaweth_set_urb_size(kaweth, KAWETH_BUF_SIZE) < 0) { |
1013 | kaweth_dbg("Error setting URB size"); | 1003 | dbg("Error setting URB size"); |
1014 | goto err_free_netdev; | 1004 | goto err_free_netdev; |
1015 | } | 1005 | } |
1016 | 1006 | ||
1017 | if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { | 1007 | if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { |
1018 | kaweth_err("Error setting SOFS wait"); | 1008 | err("Error setting SOFS wait"); |
1019 | goto err_free_netdev; | 1009 | goto err_free_netdev; |
1020 | } | 1010 | } |
1021 | 1011 | ||
@@ -1025,11 +1015,11 @@ err_fw: | |||
1025 | KAWETH_PACKET_FILTER_MULTICAST); | 1015 | KAWETH_PACKET_FILTER_MULTICAST); |
1026 | 1016 | ||
1027 | if(result < 0) { | 1017 | if(result < 0) { |
1028 | kaweth_err("Error setting receive filter"); | 1018 | err("Error setting receive filter"); |
1029 | goto err_free_netdev; | 1019 | goto err_free_netdev; |
1030 | } | 1020 | } |
1031 | 1021 | ||
1032 | kaweth_dbg("Initializing net device."); | 1022 | dbg("Initializing net device."); |
1033 | 1023 | ||
1034 | kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL); | 1024 | kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL); |
1035 | if (!kaweth->tx_urb) | 1025 | if (!kaweth->tx_urb) |
@@ -1086,13 +1076,13 @@ err_fw: | |||
1086 | 1076 | ||
1087 | SET_NETDEV_DEV(netdev, &intf->dev); | 1077 | SET_NETDEV_DEV(netdev, &intf->dev); |
1088 | if (register_netdev(netdev) != 0) { | 1078 | if (register_netdev(netdev) != 0) { |
1089 | kaweth_err("Error registering netdev."); | 1079 | err("Error registering netdev."); |
1090 | goto err_intfdata; | 1080 | goto err_intfdata; |
1091 | } | 1081 | } |
1092 | 1082 | ||
1093 | kaweth_info("kaweth interface created at %s", kaweth->net->name); | 1083 | info("kaweth interface created at %s", kaweth->net->name); |
1094 | 1084 | ||
1095 | kaweth_dbg("Kaweth probe returning."); | 1085 | dbg("Kaweth probe returning."); |
1096 | 1086 | ||
1097 | return 0; | 1087 | return 0; |
1098 | 1088 | ||
@@ -1121,16 +1111,16 @@ static void kaweth_disconnect(struct usb_interface *intf) | |||
1121 | struct kaweth_device *kaweth = usb_get_intfdata(intf); | 1111 | struct kaweth_device *kaweth = usb_get_intfdata(intf); |
1122 | struct net_device *netdev; | 1112 | struct net_device *netdev; |
1123 | 1113 | ||
1124 | kaweth_info("Unregistering"); | 1114 | info("Unregistering"); |
1125 | 1115 | ||
1126 | usb_set_intfdata(intf, NULL); | 1116 | usb_set_intfdata(intf, NULL); |
1127 | if (!kaweth) { | 1117 | if (!kaweth) { |
1128 | kaweth_warn("unregistering non-existant device"); | 1118 | warn("unregistering non-existant device"); |
1129 | return; | 1119 | return; |
1130 | } | 1120 | } |
1131 | netdev = kaweth->net; | 1121 | netdev = kaweth->net; |
1132 | 1122 | ||
1133 | kaweth_dbg("Unregistering net device"); | 1123 | dbg("Unregistering net device"); |
1134 | unregister_netdev(netdev); | 1124 | unregister_netdev(netdev); |
1135 | 1125 | ||
1136 | usb_free_urb(kaweth->rx_urb); | 1126 | usb_free_urb(kaweth->rx_urb); |
@@ -1185,7 +1175,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length) | |||
1185 | 1175 | ||
1186 | if (!wait_event_timeout(awd.wqh, awd.done, timeout)) { | 1176 | if (!wait_event_timeout(awd.wqh, awd.done, timeout)) { |
1187 | // timeout | 1177 | // timeout |
1188 | kaweth_warn("usb_control/bulk_msg: timeout"); | 1178 | warn("usb_control/bulk_msg: timeout"); |
1189 | usb_kill_urb(urb); // remove urb safely | 1179 | usb_kill_urb(urb); // remove urb safely |
1190 | status = -ETIMEDOUT; | 1180 | status = -ETIMEDOUT; |
1191 | } | 1181 | } |
@@ -1234,7 +1224,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev, | |||
1234 | ****************************************************************/ | 1224 | ****************************************************************/ |
1235 | static int __init kaweth_init(void) | 1225 | static int __init kaweth_init(void) |
1236 | { | 1226 | { |
1237 | kaweth_dbg("Driver loading"); | 1227 | dbg("Driver loading"); |
1238 | return usb_register(&kaweth_driver); | 1228 | return usb_register(&kaweth_driver); |
1239 | } | 1229 | } |
1240 | 1230 | ||