Commit bce83697c5fe84a7a5d38c96fbbe43b4bc028c3e
1 parent
02f11ee181
uwb: use dev_dbg() for debug messages
Instead of the home-grown d_fnstart(), d_fnend() and d_printf() macros, use dev_dbg() or remove the message entirely. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Showing 28 changed files with 220 additions and 1168 deletions Side-by-side Diff
- drivers/usb/host/hwa-hc.c
- drivers/usb/wusbcore/crypto.c
- drivers/usb/wusbcore/dev-sysfs.c
- drivers/usb/wusbcore/devconnect.c
- drivers/usb/wusbcore/rh.c
- drivers/usb/wusbcore/security.c
- drivers/usb/wusbcore/wa-rpipe.c
- drivers/usb/wusbcore/wa-xfer.c
- drivers/uwb/beacon.c
- drivers/uwb/est.c
- drivers/uwb/hwa-rc.c
- drivers/uwb/i1480/dfu/dfu.c
- drivers/uwb/i1480/dfu/mac.c
- drivers/uwb/i1480/dfu/usb.c
- drivers/uwb/i1480/i1480u-wlp/rx.c
- drivers/uwb/i1480/i1480u-wlp/tx.c
- drivers/uwb/lc-dev.c
- drivers/uwb/neh.c
- drivers/uwb/reset.c
- drivers/uwb/umc-dev.c
- drivers/uwb/uwbd.c
- drivers/uwb/whc-rc.c
- drivers/uwb/wlp/eda.c
- drivers/uwb/wlp/messages.c
- drivers/uwb/wlp/sysfs.c
- drivers/uwb/wlp/txrx.c
- drivers/uwb/wlp/wlp-lc.c
- drivers/uwb/wlp/wss-lc.c
drivers/usb/host/hwa-hc.c
... | ... | @@ -62,16 +62,12 @@ |
62 | 62 | #include "../wusbcore/wa-hc.h" |
63 | 63 | #include "../wusbcore/wusbhc.h" |
64 | 64 | |
65 | -#define D_LOCAL 0 | |
66 | -#include <linux/uwb/debug.h> | |
67 | - | |
68 | 65 | struct hwahc { |
69 | 66 | struct wusbhc wusbhc; /* has to be 1st */ |
70 | 67 | struct wahc wa; |
71 | - u8 buffer[16]; /* for misc usb transactions */ | |
72 | 68 | }; |
73 | 69 | |
74 | -/** | |
70 | +/* | |
75 | 71 | * FIXME should be wusbhc |
76 | 72 | * |
77 | 73 | * NOTE: we need to cache the Cluster ID because later...there is no |
... | ... | @@ -125,7 +121,6 @@ |
125 | 121 | struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc); |
126 | 122 | struct device *dev = &hwahc->wa.usb_iface->dev; |
127 | 123 | |
128 | - d_fnstart(4, dev, "(hwahc %p)\n", hwahc); | |
129 | 124 | mutex_lock(&wusbhc->mutex); |
130 | 125 | wa_nep_disarm(&hwahc->wa); |
131 | 126 | result = __wa_set_feature(&hwahc->wa, WA_RESET); |
... | ... | @@ -133,7 +128,6 @@ |
133 | 128 | dev_err(dev, "error commanding HC to reset: %d\n", result); |
134 | 129 | goto error_unlock; |
135 | 130 | } |
136 | - d_printf(3, dev, "reset: waiting for device to change state\n"); | |
137 | 131 | result = __wa_wait_status(&hwahc->wa, WA_STATUS_RESETTING, 0); |
138 | 132 | if (result < 0) { |
139 | 133 | dev_err(dev, "error waiting for HC to reset: %d\n", result); |
... | ... | @@ -141,7 +135,6 @@ |
141 | 135 | } |
142 | 136 | error_unlock: |
143 | 137 | mutex_unlock(&wusbhc->mutex); |
144 | - d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result); | |
145 | 138 | return result; |
146 | 139 | } |
147 | 140 | |
148 | 141 | |
149 | 142 | |
... | ... | @@ -154,15 +147,9 @@ |
154 | 147 | int result; |
155 | 148 | struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd); |
156 | 149 | struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc); |
157 | - struct device *dev = &hwahc->wa.usb_iface->dev; | |
158 | 150 | |
159 | - /* Set up a Host Info WUSB Information Element */ | |
160 | - d_fnstart(4, dev, "(hwahc %p)\n", hwahc); | |
161 | 151 | result = -ENOSPC; |
162 | 152 | mutex_lock(&wusbhc->mutex); |
163 | - /* Start the numbering from the top so that the bottom | |
164 | - * range of the unauth addr space is used for devices, | |
165 | - * the top for HCs; use 0xfe - RC# */ | |
166 | 153 | addr = wusb_cluster_id_get(); |
167 | 154 | if (addr == 0) |
168 | 155 | goto error_cluster_id_get; |
... | ... | @@ -176,7 +163,6 @@ |
176 | 163 | result = 0; |
177 | 164 | out: |
178 | 165 | mutex_unlock(&wusbhc->mutex); |
179 | - d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result); | |
180 | 166 | return result; |
181 | 167 | |
182 | 168 | error_set_cluster_id: |
183 | 169 | |
184 | 170 | |
185 | 171 | |
... | ... | @@ -213,18 +199,11 @@ |
213 | 199 | */ |
214 | 200 | static void hwahc_op_stop(struct usb_hcd *usb_hcd) |
215 | 201 | { |
216 | - int result; | |
217 | 202 | struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd); |
218 | - struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc); | |
219 | - struct wahc *wa = &hwahc->wa; | |
220 | - struct device *dev = &wa->usb_iface->dev; | |
221 | 203 | |
222 | - d_fnstart(4, dev, "(hwahc %p)\n", hwahc); | |
223 | 204 | mutex_lock(&wusbhc->mutex); |
224 | 205 | wusb_cluster_id_put(wusbhc->cluster_id); |
225 | 206 | mutex_unlock(&wusbhc->mutex); |
226 | - d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result); | |
227 | - return; | |
228 | 207 | } |
229 | 208 | |
230 | 209 | static int hwahc_op_get_frame_number(struct usb_hcd *usb_hcd) |
... | ... | @@ -573,11 +552,11 @@ |
573 | 552 | itr_size = le16_to_cpu(usb_dev->actconfig->desc.wTotalLength); |
574 | 553 | while (itr_size >= sizeof(*hdr)) { |
575 | 554 | hdr = (struct usb_descriptor_header *) itr; |
576 | - d_printf(3, dev, "Extra device descriptor: " | |
577 | - "type %02x/%u bytes @ %zu (%zu left)\n", | |
578 | - hdr->bDescriptorType, hdr->bLength, | |
579 | - (itr - usb_dev->rawdescriptors[actconfig_idx]), | |
580 | - itr_size); | |
555 | + dev_dbg(dev, "Extra device descriptor: " | |
556 | + "type %02x/%u bytes @ %zu (%zu left)\n", | |
557 | + hdr->bDescriptorType, hdr->bLength, | |
558 | + (itr - usb_dev->rawdescriptors[actconfig_idx]), | |
559 | + itr_size); | |
581 | 560 | if (hdr->bDescriptorType == USB_DT_WIRE_ADAPTER) |
582 | 561 | goto found; |
583 | 562 | itr += hdr->bLength; |
... | ... | @@ -786,7 +765,6 @@ |
786 | 765 | { |
787 | 766 | struct wusbhc *wusbhc = &hwahc->wusbhc; |
788 | 767 | |
789 | - d_fnstart(1, NULL, "(hwahc %p)\n", hwahc); | |
790 | 768 | mutex_lock(&wusbhc->mutex); |
791 | 769 | __wa_destroy(&hwahc->wa); |
792 | 770 | wusbhc_destroy(&hwahc->wusbhc); |
... | ... | @@ -796,7 +774,6 @@ |
796 | 774 | usb_put_intf(hwahc->wa.usb_iface); |
797 | 775 | usb_put_dev(hwahc->wa.usb_dev); |
798 | 776 | mutex_unlock(&wusbhc->mutex); |
799 | - d_fnend(1, NULL, "(hwahc %p) = void\n", hwahc); | |
800 | 777 | } |
801 | 778 | |
802 | 779 | static void hwahc_init(struct hwahc *hwahc) |
... | ... | @@ -813,7 +790,6 @@ |
813 | 790 | struct hwahc *hwahc; |
814 | 791 | struct device *dev = &usb_iface->dev; |
815 | 792 | |
816 | - d_fnstart(4, dev, "(%p, %p)\n", usb_iface, id); | |
817 | 793 | result = -ENOMEM; |
818 | 794 | usb_hcd = usb_create_hcd(&hwahc_hc_driver, &usb_iface->dev, "wusb-hwa"); |
819 | 795 | if (usb_hcd == NULL) { |
... | ... | @@ -840,7 +816,6 @@ |
840 | 816 | dev_err(dev, "Cannot setup phase B of WUSBHC: %d\n", result); |
841 | 817 | goto error_wusbhc_b_create; |
842 | 818 | } |
843 | - d_fnend(4, dev, "(%p, %p) = 0\n", usb_iface, id); | |
844 | 819 | return 0; |
845 | 820 | |
846 | 821 | error_wusbhc_b_create: |
... | ... | @@ -850,7 +825,6 @@ |
850 | 825 | error_hwahc_create: |
851 | 826 | usb_put_hcd(usb_hcd); |
852 | 827 | error_alloc: |
853 | - d_fnend(4, dev, "(%p, %p) = %d\n", usb_iface, id, result); | |
854 | 828 | return result; |
855 | 829 | } |
856 | 830 | |
857 | 831 | |
858 | 832 | |
... | ... | @@ -864,16 +838,12 @@ |
864 | 838 | wusbhc = usb_hcd_to_wusbhc(usb_hcd); |
865 | 839 | hwahc = container_of(wusbhc, struct hwahc, wusbhc); |
866 | 840 | |
867 | - d_fnstart(1, NULL, "(hwahc %p [usb_iface %p])\n", hwahc, usb_iface); | |
868 | 841 | wusbhc_b_destroy(&hwahc->wusbhc); |
869 | 842 | usb_remove_hcd(usb_hcd); |
870 | 843 | hwahc_destroy(hwahc); |
871 | 844 | usb_put_hcd(usb_hcd); |
872 | - d_fnend(1, NULL, "(hwahc %p [usb_iface %p]) = void\n", hwahc, | |
873 | - usb_iface); | |
874 | 845 | } |
875 | 846 | |
876 | -/** USB device ID's that we handle */ | |
877 | 847 | static struct usb_device_id hwahc_id_table[] = { |
878 | 848 | /* FIXME: use class labels for this */ |
879 | 849 | { USB_INTERFACE_INFO(0xe0, 0x02, 0x01), }, |
... | ... | @@ -890,18 +860,7 @@ |
890 | 860 | |
891 | 861 | static int __init hwahc_driver_init(void) |
892 | 862 | { |
893 | - int result; | |
894 | - result = usb_register(&hwahc_driver); | |
895 | - if (result < 0) { | |
896 | - printk(KERN_ERR "WA-CDS: Cannot register USB driver: %d\n", | |
897 | - result); | |
898 | - goto error_usb_register; | |
899 | - } | |
900 | - return 0; | |
901 | - | |
902 | -error_usb_register: | |
903 | - return result; | |
904 | - | |
863 | + return usb_register(&hwahc_driver); | |
905 | 864 | } |
906 | 865 | module_init(hwahc_driver_init); |
907 | 866 |
drivers/usb/wusbcore/crypto.c
... | ... | @@ -51,7 +51,6 @@ |
51 | 51 | #include <linux/uwb.h> |
52 | 52 | #include <linux/usb/wusb.h> |
53 | 53 | #include <linux/scatterlist.h> |
54 | -#define D_LOCAL 0 | |
55 | 54 | #include <linux/uwb/debug.h> |
56 | 55 | |
57 | 56 | static int debug_crypto_verify = 0; |
... | ... | @@ -207,9 +206,6 @@ |
207 | 206 | const u8 bzero[16] = { 0 }; |
208 | 207 | size_t zero_padding; |
209 | 208 | |
210 | - d_fnstart(3, NULL, "(tfm_cbc %p, tfm_aes %p, mic %p, " | |
211 | - "n %p, a %p, b %p, blen %zu)\n", | |
212 | - tfm_cbc, tfm_aes, mic, n, a, b, blen); | |
213 | 209 | /* |
214 | 210 | * These checks should be compile time optimized out |
215 | 211 | * ensure @a fills b1's mac_header and following fields |
... | ... | @@ -251,16 +247,6 @@ |
251 | 247 | b1.la = cpu_to_be16(blen + 14); |
252 | 248 | memcpy(&b1.mac_header, a, sizeof(*a)); |
253 | 249 | |
254 | - d_printf(4, NULL, "I: B0 (%zu bytes)\n", sizeof(b0)); | |
255 | - d_dump(4, NULL, &b0, sizeof(b0)); | |
256 | - d_printf(4, NULL, "I: B1 (%zu bytes)\n", sizeof(b1)); | |
257 | - d_dump(4, NULL, &b1, sizeof(b1)); | |
258 | - d_printf(4, NULL, "I: B (%zu bytes)\n", blen); | |
259 | - d_dump(4, NULL, b, blen); | |
260 | - d_printf(4, NULL, "I: B 0-padding (%zu bytes)\n", zero_padding); | |
261 | - d_printf(4, NULL, "D: IV before crypto (%zu)\n", ivsize); | |
262 | - d_dump(4, NULL, iv, ivsize); | |
263 | - | |
264 | 250 | sg_init_table(sg, ARRAY_SIZE(sg)); |
265 | 251 | sg_set_buf(&sg[0], &b0, sizeof(b0)); |
266 | 252 | sg_set_buf(&sg[1], &b1, sizeof(b1)); |
... | ... | @@ -277,8 +263,6 @@ |
277 | 263 | result); |
278 | 264 | goto error_cbc_crypt; |
279 | 265 | } |
280 | - d_printf(4, NULL, "D: MIC tag\n"); | |
281 | - d_dump(4, NULL, iv, ivsize); | |
282 | 266 | |
283 | 267 | /* Now we crypt the MIC Tag (*iv) with Ax -- values per WUSB1.0[6.5] |
284 | 268 | * The procedure is to AES crypt the A0 block and XOR the MIC |
285 | 269 | |
... | ... | @@ -293,17 +277,10 @@ |
293 | 277 | ax.counter = 0; |
294 | 278 | crypto_cipher_encrypt_one(tfm_aes, (void *)&ax, (void *)&ax); |
295 | 279 | bytewise_xor(mic, &ax, iv, 8); |
296 | - d_printf(4, NULL, "D: CTR[MIC]\n"); | |
297 | - d_dump(4, NULL, &ax, 8); | |
298 | - d_printf(4, NULL, "D: CCM-MIC tag\n"); | |
299 | - d_dump(4, NULL, mic, 8); | |
300 | 280 | result = 8; |
301 | 281 | error_cbc_crypt: |
302 | 282 | kfree(dst_buf); |
303 | 283 | error_dst_buf: |
304 | - d_fnend(3, NULL, "(tfm_cbc %p, tfm_aes %p, mic %p, " | |
305 | - "n %p, a %p, b %p, blen %zu)\n", | |
306 | - tfm_cbc, tfm_aes, mic, n, a, b, blen); | |
307 | 284 | return result; |
308 | 285 | } |
309 | 286 | |
... | ... | @@ -325,10 +302,6 @@ |
325 | 302 | u64 sfn = 0; |
326 | 303 | __le64 sfn_le; |
327 | 304 | |
328 | - d_fnstart(3, NULL, "(out %p, out_size %zu, key %p, _n %p, " | |
329 | - "a %p, b %p, blen %zu, len %zu)\n", out, out_size, | |
330 | - key, _n, a, b, blen, len); | |
331 | - | |
332 | 305 | tfm_cbc = crypto_alloc_blkcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC); |
333 | 306 | if (IS_ERR(tfm_cbc)) { |
334 | 307 | result = PTR_ERR(tfm_cbc); |
... | ... | @@ -370,9 +343,6 @@ |
370 | 343 | error_setkey_cbc: |
371 | 344 | crypto_free_blkcipher(tfm_cbc); |
372 | 345 | error_alloc_cbc: |
373 | - d_fnend(3, NULL, "(out %p, out_size %zu, key %p, _n %p, " | |
374 | - "a %p, b %p, blen %zu, len %zu) = %d\n", out, out_size, | |
375 | - key, _n, a, b, blen, len, (int)bytes); | |
376 | 346 | return result; |
377 | 347 | } |
378 | 348 |
drivers/usb/wusbcore/dev-sysfs.c
... | ... | @@ -28,10 +28,6 @@ |
28 | 28 | #include <linux/workqueue.h> |
29 | 29 | #include "wusbhc.h" |
30 | 30 | |
31 | -#undef D_LOCAL | |
32 | -#define D_LOCAL 4 | |
33 | -#include <linux/uwb/debug.h> | |
34 | - | |
35 | 31 | static ssize_t wusb_disconnect_store(struct device *dev, |
36 | 32 | struct device_attribute *attr, |
37 | 33 | const char *buf, size_t size) |
drivers/usb/wusbcore/devconnect.c
... | ... | @@ -91,10 +91,6 @@ |
91 | 91 | #include <linux/workqueue.h> |
92 | 92 | #include "wusbhc.h" |
93 | 93 | |
94 | -#undef D_LOCAL | |
95 | -#define D_LOCAL 1 | |
96 | -#include <linux/uwb/debug.h> | |
97 | - | |
98 | 94 | static void wusbhc_devconnect_acked_work(struct work_struct *work); |
99 | 95 | |
100 | 96 | static void wusb_dev_free(struct wusb_dev *wusb_dev) |
... | ... | @@ -234,6 +230,7 @@ |
234 | 230 | list_add_tail(&wusb_dev->cack_node, &wusbhc->cack_list); |
235 | 231 | wusbhc->cack_count++; |
236 | 232 | wusbhc_fill_cack_ie(wusbhc); |
233 | + | |
237 | 234 | return wusb_dev; |
238 | 235 | } |
239 | 236 | |
240 | 237 | |
... | ... | @@ -244,12 +241,9 @@ |
244 | 241 | */ |
245 | 242 | static void wusbhc_cack_rm(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev) |
246 | 243 | { |
247 | - struct device *dev = wusbhc->dev; | |
248 | - d_fnstart(3, dev, "(wusbhc %p wusb_dev %p)\n", wusbhc, wusb_dev); | |
249 | 244 | list_del_init(&wusb_dev->cack_node); |
250 | 245 | wusbhc->cack_count--; |
251 | 246 | wusbhc_fill_cack_ie(wusbhc); |
252 | - d_fnend(3, dev, "(wusbhc %p wusb_dev %p) = void\n", wusbhc, wusb_dev); | |
253 | 247 | } |
254 | 248 | |
255 | 249 | /* |
256 | 250 | |
... | ... | @@ -257,14 +251,11 @@ |
257 | 251 | static |
258 | 252 | void wusbhc_devconnect_acked(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev) |
259 | 253 | { |
260 | - struct device *dev = wusbhc->dev; | |
261 | - d_fnstart(3, dev, "(wusbhc %p wusb_dev %p)\n", wusbhc, wusb_dev); | |
262 | 254 | wusbhc_cack_rm(wusbhc, wusb_dev); |
263 | 255 | if (wusbhc->cack_count) |
264 | 256 | wusbhc_mmcie_set(wusbhc, 0, 0, &wusbhc->cack_ie.hdr); |
265 | 257 | else |
266 | 258 | wusbhc_mmcie_rm(wusbhc, &wusbhc->cack_ie.hdr); |
267 | - d_fnend(3, dev, "(wusbhc %p wusb_dev %p) = void\n", wusbhc, wusb_dev); | |
268 | 259 | } |
269 | 260 | |
270 | 261 | static void wusbhc_devconnect_acked_work(struct work_struct *work) |
... | ... | @@ -314,7 +305,6 @@ |
314 | 305 | struct wusb_port *port; |
315 | 306 | unsigned idx, devnum; |
316 | 307 | |
317 | - d_fnstart(3, dev, "(%p, %p, %s)\n", wusbhc, dnc, pr_cdid); | |
318 | 308 | mutex_lock(&wusbhc->mutex); |
319 | 309 | |
320 | 310 | /* Check we are not handling it already */ |
... | ... | @@ -367,7 +357,6 @@ |
367 | 357 | */ |
368 | 358 | error_unlock: |
369 | 359 | mutex_unlock(&wusbhc->mutex); |
370 | - d_fnend(3, dev, "(%p, %p, %s) = void\n", wusbhc, dnc, pr_cdid); | |
371 | 360 | return; |
372 | 361 | |
373 | 362 | } |
374 | 363 | |
... | ... | @@ -390,10 +379,8 @@ |
390 | 379 | static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc, |
391 | 380 | struct wusb_port *port) |
392 | 381 | { |
393 | - struct device *dev = wusbhc->dev; | |
394 | 382 | struct wusb_dev *wusb_dev = port->wusb_dev; |
395 | 383 | |
396 | - d_fnstart(3, dev, "(wusbhc %p, port %p)\n", wusbhc, port); | |
397 | 384 | port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE |
398 | 385 | | USB_PORT_STAT_SUSPEND | USB_PORT_STAT_RESET |
399 | 386 | | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED); |
... | ... | @@ -410,7 +397,6 @@ |
410 | 397 | * section 6.2.11.2). */ |
411 | 398 | wusbhc_gtk_rekey(wusbhc); |
412 | 399 | |
413 | - d_fnend(3, dev, "(wusbhc %p, port %p) = void\n", wusbhc, port); | |
414 | 400 | /* The Wireless USB part has forgotten about the device already; now |
415 | 401 | * khubd's timer will pick up the disconnection and remove the USB |
416 | 402 | * device from the system |
... | ... | @@ -535,10 +521,6 @@ |
535 | 521 | */ |
536 | 522 | static void wusbhc_handle_dn_alive(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev) |
537 | 523 | { |
538 | - struct device *dev = wusbhc->dev; | |
539 | - | |
540 | - d_printf(2, dev, "DN ALIVE: device 0x%02x pong\n", wusb_dev->addr); | |
541 | - | |
542 | 524 | mutex_lock(&wusbhc->mutex); |
543 | 525 | wusb_dev->entry_ts = jiffies; |
544 | 526 | __wusbhc_keep_alive(wusbhc); |
545 | 527 | |
... | ... | @@ -571,11 +553,10 @@ |
571 | 553 | "no-beacon" |
572 | 554 | }; |
573 | 555 | |
574 | - d_fnstart(3, dev, "(%p, %p, %zu)\n", wusbhc, dn_hdr, size); | |
575 | 556 | if (size < sizeof(*dnc)) { |
576 | 557 | dev_err(dev, "DN CONNECT: short notification (%zu < %zu)\n", |
577 | 558 | size, sizeof(*dnc)); |
578 | - goto out; | |
559 | + return; | |
579 | 560 | } |
580 | 561 | |
581 | 562 | dnc = container_of(dn_hdr, struct wusb_dn_connect, hdr); |
... | ... | @@ -587,10 +568,6 @@ |
587 | 568 | wusb_dn_connect_new_connection(dnc) ? "connect" : "reconnect"); |
588 | 569 | /* ACK the connect */ |
589 | 570 | wusbhc_devconnect_ack(wusbhc, dnc, pr_cdid); |
590 | -out: | |
591 | - d_fnend(3, dev, "(%p, %p, %zu) = void\n", | |
592 | - wusbhc, dn_hdr, size); | |
593 | - return; | |
594 | 571 | } |
595 | 572 | |
596 | 573 | /* |
597 | 574 | |
598 | 575 | |
... | ... | @@ -631,19 +608,17 @@ |
631 | 608 | struct device *dev = wusbhc->dev; |
632 | 609 | struct wusb_dev *wusb_dev; |
633 | 610 | |
634 | - d_fnstart(3, dev, "(%p, %p)\n", wusbhc, dn_hdr); | |
635 | - | |
636 | 611 | if (size < sizeof(struct wusb_dn_hdr)) { |
637 | 612 | dev_err(dev, "DN data shorter than DN header (%d < %d)\n", |
638 | 613 | (int)size, (int)sizeof(struct wusb_dn_hdr)); |
639 | - goto out; | |
614 | + return; | |
640 | 615 | } |
641 | 616 | |
642 | 617 | wusb_dev = wusbhc_find_dev_by_addr(wusbhc, srcaddr); |
643 | 618 | if (wusb_dev == NULL && dn_hdr->bType != WUSB_DN_CONNECT) { |
644 | 619 | dev_dbg(dev, "ignoring DN %d from unconnected device %02x\n", |
645 | 620 | dn_hdr->bType, srcaddr); |
646 | - goto out; | |
621 | + return; | |
647 | 622 | } |
648 | 623 | |
649 | 624 | switch (dn_hdr->bType) { |
... | ... | @@ -668,9 +643,6 @@ |
668 | 643 | dev_warn(dev, "unknown DN %u (%d octets) from %u\n", |
669 | 644 | dn_hdr->bType, (int)size, srcaddr); |
670 | 645 | } |
671 | -out: | |
672 | - d_fnend(3, dev, "(%p, %p) = void\n", wusbhc, dn_hdr); | |
673 | - return; | |
674 | 646 | } |
675 | 647 | EXPORT_SYMBOL_GPL(wusbhc_handle_dn); |
676 | 648 | |
677 | 649 | |
678 | 650 | |
679 | 651 | |
680 | 652 | |
681 | 653 | |
682 | 654 | |
683 | 655 | |
684 | 656 | |
... | ... | @@ -700,61 +672,32 @@ |
700 | 672 | struct wusb_dev *wusb_dev; |
701 | 673 | struct wuie_disconnect *ie; |
702 | 674 | |
703 | - d_fnstart(3, dev, "(%p, %u)\n", wusbhc, port_idx); | |
704 | - result = 0; | |
705 | 675 | wusb_dev = wusb_port_by_idx(wusbhc, port_idx)->wusb_dev; |
706 | 676 | if (wusb_dev == NULL) { |
707 | 677 | /* reset no device? ignore */ |
708 | 678 | dev_dbg(dev, "DISCONNECT: no device at port %u, ignoring\n", |
709 | 679 | port_idx); |
710 | - goto error; | |
680 | + return; | |
711 | 681 | } |
712 | 682 | __wusbhc_dev_disconnect(wusbhc, wusb_port_by_idx(wusbhc, port_idx)); |
713 | 683 | |
714 | - result = -ENOMEM; | |
715 | 684 | ie = kzalloc(sizeof(*ie), GFP_KERNEL); |
716 | 685 | if (ie == NULL) |
717 | - goto error; | |
686 | + return; | |
718 | 687 | ie->hdr.bLength = sizeof(*ie); |
719 | 688 | ie->hdr.bIEIdentifier = WUIE_ID_DEVICE_DISCONNECT; |
720 | 689 | ie->bDeviceAddress = wusb_dev->addr; |
721 | 690 | result = wusbhc_mmcie_set(wusbhc, 0, 0, &ie->hdr); |
722 | - if (result < 0) { | |
691 | + if (result < 0) | |
723 | 692 | dev_err(dev, "DISCONNECT: can't set MMC: %d\n", result); |
724 | - goto error_kfree; | |
693 | + else { | |
694 | + /* At least 6 MMCs, assuming at least 1 MMC per zone. */ | |
695 | + msleep(7*4); | |
696 | + wusbhc_mmcie_rm(wusbhc, &ie->hdr); | |
725 | 697 | } |
726 | - | |
727 | - /* 120ms, hopefully 6 MMCs */ | |
728 | - msleep(100); | |
729 | - wusbhc_mmcie_rm(wusbhc, &ie->hdr); | |
730 | -error_kfree: | |
731 | 698 | kfree(ie); |
732 | -error: | |
733 | - d_fnend(3, dev, "(%p, %u) = %d\n", wusbhc, port_idx, result); | |
734 | - return; | |
735 | 699 | } |
736 | 700 | |
737 | -static void wusb_cap_descr_printf(const unsigned level, struct device *dev, | |
738 | - const struct usb_wireless_cap_descriptor *wcd) | |
739 | -{ | |
740 | - d_printf(level, dev, | |
741 | - "WUSB Capability Descriptor\n" | |
742 | - " bDevCapabilityType 0x%02x\n" | |
743 | - " bmAttributes 0x%02x\n" | |
744 | - " wPhyRates 0x%04x\n" | |
745 | - " bmTFITXPowerInfo 0x%02x\n" | |
746 | - " bmFFITXPowerInfo 0x%02x\n" | |
747 | - " bmBandGroup 0x%04x\n" | |
748 | - " bReserved 0x%02x\n", | |
749 | - wcd->bDevCapabilityType, | |
750 | - wcd->bmAttributes, | |
751 | - le16_to_cpu(wcd->wPHYRates), | |
752 | - wcd->bmTFITXPowerInfo, | |
753 | - wcd->bmFFITXPowerInfo, | |
754 | - wcd->bmBandGroup, | |
755 | - wcd->bReserved); | |
756 | -} | |
757 | - | |
758 | 701 | /* |
759 | 702 | * Walk over the BOS descriptor, verify and grok it |
760 | 703 | * |
... | ... | @@ -795,8 +738,6 @@ |
795 | 738 | } |
796 | 739 | cap_size = cap_hdr->bLength; |
797 | 740 | cap_type = cap_hdr->bDevCapabilityType; |
798 | - d_printf(4, dev, "BOS Capability: 0x%02x (%zu bytes)\n", | |
799 | - cap_type, cap_size); | |
800 | 741 | if (cap_size == 0) |
801 | 742 | break; |
802 | 743 | if (cap_size > top - itr) { |
... | ... | @@ -808,7 +749,6 @@ |
808 | 749 | result = -EBADF; |
809 | 750 | goto error_bad_cap; |
810 | 751 | } |
811 | - d_dump(3, dev, itr, cap_size); | |
812 | 752 | switch (cap_type) { |
813 | 753 | case USB_CAP_TYPE_WIRELESS_USB: |
814 | 754 | if (cap_size != sizeof(*wusb_dev->wusb_cap_descr)) |
815 | 755 | |
... | ... | @@ -816,10 +756,8 @@ |
816 | 756 | "descriptor is %zu bytes vs %zu " |
817 | 757 | "needed\n", cap_size, |
818 | 758 | sizeof(*wusb_dev->wusb_cap_descr)); |
819 | - else { | |
759 | + else | |
820 | 760 | wusb_dev->wusb_cap_descr = itr; |
821 | - wusb_cap_descr_printf(3, dev, itr); | |
822 | - } | |
823 | 761 | break; |
824 | 762 | default: |
825 | 763 | dev_err(dev, "BUG? Unknown BOS capability 0x%02x " |
... | ... | @@ -884,9 +822,7 @@ |
884 | 822 | "%zu bytes): %zd\n", desc_size, result); |
885 | 823 | goto error_get_descriptor; |
886 | 824 | } |
887 | - d_printf(2, dev, "Got BOS descriptor %zd bytes, %u capabilities\n", | |
888 | - result, bos->bNumDeviceCaps); | |
889 | - d_dump(2, dev, bos, result); | |
825 | + | |
890 | 826 | result = wusb_dev_bos_grok(usb_dev, wusb_dev, bos, result); |
891 | 827 | if (result < 0) |
892 | 828 | goto error_bad_bos; |
... | ... | @@ -952,8 +888,6 @@ |
952 | 888 | if (usb_dev->wusb == 0 || usb_dev->devnum == 1) |
953 | 889 | return; /* skip non wusb and wusb RHs */ |
954 | 890 | |
955 | - d_fnstart(3, dev, "(usb_dev %p)\n", usb_dev); | |
956 | - | |
957 | 891 | wusbhc = wusbhc_get_by_usb_dev(usb_dev); |
958 | 892 | if (wusbhc == NULL) |
959 | 893 | goto error_nodev; |
... | ... | @@ -983,7 +917,6 @@ |
983 | 917 | wusb_dev_put(wusb_dev); |
984 | 918 | wusbhc_put(wusbhc); |
985 | 919 | error_nodev: |
986 | - d_fnend(3, dev, "(usb_dev %p) = void\n", usb_dev); | |
987 | 920 | return; |
988 | 921 | |
989 | 922 | wusb_dev_sysfs_rm(wusb_dev); |
990 | 923 | |
... | ... | @@ -1070,11 +1003,10 @@ |
1070 | 1003 | |
1071 | 1004 | void wusb_dev_destroy(struct kref *_wusb_dev) |
1072 | 1005 | { |
1073 | - struct wusb_dev *wusb_dev | |
1074 | - = container_of(_wusb_dev, struct wusb_dev, refcnt); | |
1006 | + struct wusb_dev *wusb_dev = container_of(_wusb_dev, struct wusb_dev, refcnt); | |
1007 | + | |
1075 | 1008 | list_del_init(&wusb_dev->cack_node); |
1076 | 1009 | wusb_dev_free(wusb_dev); |
1077 | - d_fnend(1, NULL, "%s (wusb_dev %p) = void\n", __func__, wusb_dev); | |
1078 | 1010 | } |
1079 | 1011 | EXPORT_SYMBOL_GPL(wusb_dev_destroy); |
1080 | 1012 | |
... | ... | @@ -1086,8 +1018,6 @@ |
1086 | 1018 | */ |
1087 | 1019 | int wusbhc_devconnect_create(struct wusbhc *wusbhc) |
1088 | 1020 | { |
1089 | - d_fnstart(3, wusbhc->dev, "(wusbhc %p)\n", wusbhc); | |
1090 | - | |
1091 | 1021 | wusbhc->keep_alive_ie.hdr.bIEIdentifier = WUIE_ID_KEEP_ALIVE; |
1092 | 1022 | wusbhc->keep_alive_ie.hdr.bLength = sizeof(wusbhc->keep_alive_ie.hdr); |
1093 | 1023 | INIT_DELAYED_WORK(&wusbhc->keep_alive_timer, wusbhc_keep_alive_run); |
... | ... | @@ -1096,7 +1026,6 @@ |
1096 | 1026 | wusbhc->cack_ie.hdr.bLength = sizeof(wusbhc->cack_ie.hdr); |
1097 | 1027 | INIT_LIST_HEAD(&wusbhc->cack_list); |
1098 | 1028 | |
1099 | - d_fnend(3, wusbhc->dev, "(wusbhc %p) = void\n", wusbhc); | |
1100 | 1029 | return 0; |
1101 | 1030 | } |
1102 | 1031 | |
... | ... | @@ -1105,8 +1034,7 @@ |
1105 | 1034 | */ |
1106 | 1035 | void wusbhc_devconnect_destroy(struct wusbhc *wusbhc) |
1107 | 1036 | { |
1108 | - d_fnstart(3, wusbhc->dev, "(wusbhc %p)\n", wusbhc); | |
1109 | - d_fnend(3, wusbhc->dev, "(wusbhc %p) = void\n", wusbhc); | |
1037 | + /* no op */ | |
1110 | 1038 | } |
1111 | 1039 | |
1112 | 1040 | /* |
drivers/usb/wusbcore/rh.c
... | ... | @@ -71,9 +71,6 @@ |
71 | 71 | */ |
72 | 72 | #include "wusbhc.h" |
73 | 73 | |
74 | -#define D_LOCAL 0 | |
75 | -#include <linux/uwb/debug.h> | |
76 | - | |
77 | 74 | /* |
78 | 75 | * Reset a fake port |
79 | 76 | * |
... | ... | @@ -142,7 +139,6 @@ |
142 | 139 | size_t cnt, size; |
143 | 140 | unsigned long *buf = (unsigned long *) _buf; |
144 | 141 | |
145 | - d_fnstart(1, wusbhc->dev, "(wusbhc %p)\n", wusbhc); | |
146 | 142 | /* WE DON'T LOCK, see comment */ |
147 | 143 | size = wusbhc->ports_max + 1 /* hub bit */; |
148 | 144 | size = (size + 8 - 1) / 8; /* round to bytes */ |
... | ... | @@ -151,8 +147,6 @@ |
151 | 147 | set_bit(cnt + 1, buf); |
152 | 148 | else |
153 | 149 | clear_bit(cnt + 1, buf); |
154 | - d_fnend(1, wusbhc->dev, "(wusbhc %p) %u, buffer:\n", wusbhc, (int)size); | |
155 | - d_dump(1, wusbhc->dev, _buf, size); | |
156 | 150 | return size; |
157 | 151 | } |
158 | 152 | EXPORT_SYMBOL_GPL(wusbhc_rh_status_data); |
159 | 153 | |
... | ... | @@ -201,9 +195,7 @@ |
201 | 195 | static int wusbhc_rh_clear_hub_feat(struct wusbhc *wusbhc, u16 feature) |
202 | 196 | { |
203 | 197 | int result; |
204 | - struct device *dev = wusbhc->dev; | |
205 | 198 | |
206 | - d_fnstart(4, dev, "(%p, feature 0x%04u)\n", wusbhc, feature); | |
207 | 199 | switch (feature) { |
208 | 200 | case C_HUB_LOCAL_POWER: |
209 | 201 | /* FIXME: maybe plug bit 0 to the power input status, |
... | ... | @@ -215,7 +207,6 @@ |
215 | 207 | default: |
216 | 208 | result = -EPIPE; |
217 | 209 | } |
218 | - d_fnend(4, dev, "(%p, feature 0x%04u), %d\n", wusbhc, feature, result); | |
219 | 210 | return result; |
220 | 211 | } |
221 | 212 | |
222 | 213 | |
223 | 214 | |
... | ... | @@ -242,14 +233,10 @@ |
242 | 233 | static int wusbhc_rh_set_port_feat(struct wusbhc *wusbhc, u16 feature, |
243 | 234 | u8 selector, u8 port_idx) |
244 | 235 | { |
245 | - int result = -EINVAL; | |
246 | 236 | struct device *dev = wusbhc->dev; |
247 | 237 | |
248 | - d_fnstart(4, dev, "(feat 0x%04u, selector 0x%u, port_idx %d)\n", | |
249 | - feature, selector, port_idx); | |
250 | - | |
251 | 238 | if (port_idx > wusbhc->ports_max) |
252 | - goto error; | |
239 | + return -EINVAL; | |
253 | 240 | |
254 | 241 | switch (feature) { |
255 | 242 | /* According to USB2.0[11.24.2.13]p2, these features |
256 | 243 | |
257 | 244 | |
258 | 245 | |
259 | 246 | |
260 | 247 | |
... | ... | @@ -259,35 +246,27 @@ |
259 | 246 | case USB_PORT_FEAT_C_SUSPEND: |
260 | 247 | case USB_PORT_FEAT_C_CONNECTION: |
261 | 248 | case USB_PORT_FEAT_C_RESET: |
262 | - result = 0; | |
263 | - break; | |
264 | - | |
249 | + return 0; | |
265 | 250 | case USB_PORT_FEAT_POWER: |
266 | 251 | /* No such thing, but we fake it works */ |
267 | 252 | mutex_lock(&wusbhc->mutex); |
268 | 253 | wusb_port_by_idx(wusbhc, port_idx)->status |= USB_PORT_STAT_POWER; |
269 | 254 | mutex_unlock(&wusbhc->mutex); |
270 | - result = 0; | |
271 | - break; | |
255 | + return 0; | |
272 | 256 | case USB_PORT_FEAT_RESET: |
273 | - result = wusbhc_rh_port_reset(wusbhc, port_idx); | |
274 | - break; | |
257 | + return wusbhc_rh_port_reset(wusbhc, port_idx); | |
275 | 258 | case USB_PORT_FEAT_ENABLE: |
276 | 259 | case USB_PORT_FEAT_SUSPEND: |
277 | 260 | dev_err(dev, "(port_idx %d) set feat %d/%d UNIMPLEMENTED\n", |
278 | 261 | port_idx, feature, selector); |
279 | - result = -ENOSYS; | |
280 | - break; | |
262 | + return -ENOSYS; | |
281 | 263 | default: |
282 | 264 | dev_err(dev, "(port_idx %d) set feat %d/%d UNKNOWN\n", |
283 | 265 | port_idx, feature, selector); |
284 | - result = -EPIPE; | |
285 | - break; | |
266 | + return -EPIPE; | |
286 | 267 | } |
287 | -error: | |
288 | - d_fnend(4, dev, "(feat 0x%04u, selector 0x%u, port_idx %d) = %d\n", | |
289 | - feature, selector, port_idx, result); | |
290 | - return result; | |
268 | + | |
269 | + return 0; | |
291 | 270 | } |
292 | 271 | |
293 | 272 | /* |
294 | 273 | |
295 | 274 | |
296 | 275 | |
... | ... | @@ -298,17 +277,13 @@ |
298 | 277 | static int wusbhc_rh_clear_port_feat(struct wusbhc *wusbhc, u16 feature, |
299 | 278 | u8 selector, u8 port_idx) |
300 | 279 | { |
301 | - int result = -EINVAL; | |
280 | + int result = 0; | |
302 | 281 | struct device *dev = wusbhc->dev; |
303 | 282 | |
304 | - d_fnstart(4, dev, "(wusbhc %p feat 0x%04x selector %d port_idx %d)\n", | |
305 | - wusbhc, feature, selector, port_idx); | |
306 | - | |
307 | 283 | if (port_idx > wusbhc->ports_max) |
308 | - goto error; | |
284 | + return -EINVAL; | |
309 | 285 | |
310 | 286 | mutex_lock(&wusbhc->mutex); |
311 | - result = 0; | |
312 | 287 | switch (feature) { |
313 | 288 | case USB_PORT_FEAT_POWER: /* fake port always on */ |
314 | 289 | /* According to USB2.0[11.24.2.7.1.4], no need to implement? */ |
315 | 290 | |
... | ... | @@ -328,10 +303,8 @@ |
328 | 303 | break; |
329 | 304 | case USB_PORT_FEAT_SUSPEND: |
330 | 305 | case USB_PORT_FEAT_C_SUSPEND: |
331 | - case 0xffff: /* ??? FIXME */ | |
332 | 306 | dev_err(dev, "(port_idx %d) Clear feat %d/%d UNIMPLEMENTED\n", |
333 | 307 | port_idx, feature, selector); |
334 | - /* dump_stack(); */ | |
335 | 308 | result = -ENOSYS; |
336 | 309 | break; |
337 | 310 | default: |
... | ... | @@ -341,9 +314,7 @@ |
341 | 314 | break; |
342 | 315 | } |
343 | 316 | mutex_unlock(&wusbhc->mutex); |
344 | -error: | |
345 | - d_fnend(4, dev, "(wusbhc %p feat 0x%04x selector %d port_idx %d) = " | |
346 | - "%d\n", wusbhc, feature, selector, port_idx, result); | |
317 | + | |
347 | 318 | return result; |
348 | 319 | } |
349 | 320 | |
350 | 321 | |
351 | 322 | |
352 | 323 | |
353 | 324 | |
... | ... | @@ -355,22 +326,17 @@ |
355 | 326 | static int wusbhc_rh_get_port_status(struct wusbhc *wusbhc, u16 port_idx, |
356 | 327 | u32 *_buf, u16 wLength) |
357 | 328 | { |
358 | - int result = -EINVAL; | |
359 | 329 | u16 *buf = (u16 *) _buf; |
360 | 330 | |
361 | - d_fnstart(1, wusbhc->dev, "(wusbhc %p port_idx %u wLength %u)\n", | |
362 | - wusbhc, port_idx, wLength); | |
363 | 331 | if (port_idx > wusbhc->ports_max) |
364 | - goto error; | |
332 | + return -EINVAL; | |
333 | + | |
365 | 334 | mutex_lock(&wusbhc->mutex); |
366 | 335 | buf[0] = cpu_to_le16(wusb_port_by_idx(wusbhc, port_idx)->status); |
367 | 336 | buf[1] = cpu_to_le16(wusb_port_by_idx(wusbhc, port_idx)->change); |
368 | - result = 0; | |
369 | 337 | mutex_unlock(&wusbhc->mutex); |
370 | -error: | |
371 | - d_fnend(1, wusbhc->dev, "(wusbhc %p) = %d, buffer:\n", wusbhc, result); | |
372 | - d_dump(1, wusbhc->dev, _buf, wLength); | |
373 | - return result; | |
338 | + | |
339 | + return 0; | |
374 | 340 | } |
375 | 341 | |
376 | 342 | /* |
drivers/usb/wusbcore/security.c
... | ... | @@ -27,19 +27,6 @@ |
27 | 27 | #include <linux/random.h> |
28 | 28 | #include "wusbhc.h" |
29 | 29 | |
30 | -/* | |
31 | - * DEBUG & SECURITY WARNING!!!! | |
32 | - * | |
33 | - * If you enable this past 1, the debug code will weaken the | |
34 | - * cryptographic safety of the system (on purpose, for debugging). | |
35 | - * | |
36 | - * Weaken means: | |
37 | - * we print secret keys and intermediate values all the way, | |
38 | - */ | |
39 | -#undef D_LOCAL | |
40 | -#define D_LOCAL 2 | |
41 | -#include <linux/uwb/debug.h> | |
42 | - | |
43 | 30 | static void wusbhc_set_gtk_callback(struct urb *urb); |
44 | 31 | static void wusbhc_gtk_rekey_done_work(struct work_struct *work); |
45 | 32 | |
... | ... | @@ -219,7 +206,6 @@ |
219 | 206 | const void *itr, *top; |
220 | 207 | char buf[64]; |
221 | 208 | |
222 | - d_fnstart(3, dev, "(usb_dev %p, wusb_dev %p)\n", usb_dev, wusb_dev); | |
223 | 209 | result = usb_get_descriptor(usb_dev, USB_DT_SECURITY, |
224 | 210 | 0, &secd, sizeof(secd)); |
225 | 211 | if (result < sizeof(secd)) { |
... | ... | @@ -228,8 +214,6 @@ |
228 | 214 | goto error_secd; |
229 | 215 | } |
230 | 216 | secd_size = le16_to_cpu(secd.wTotalLength); |
231 | - d_printf(5, dev, "got %d bytes of sec descriptor, total is %d\n", | |
232 | - result, secd_size); | |
233 | 217 | secd_buf = kmalloc(secd_size, GFP_KERNEL); |
234 | 218 | if (secd_buf == NULL) { |
235 | 219 | dev_err(dev, "Can't allocate space for security descriptors\n"); |
... | ... | @@ -242,7 +226,6 @@ |
242 | 226 | "not enough data: %d\n", result); |
243 | 227 | goto error_secd_all; |
244 | 228 | } |
245 | - d_printf(5, dev, "got %d bytes of sec descriptors\n", result); | |
246 | 229 | bytes = 0; |
247 | 230 | itr = secd_buf + sizeof(secd); |
248 | 231 | top = secd_buf + result; |
249 | 232 | |
... | ... | @@ -279,14 +262,12 @@ |
279 | 262 | goto error_no_ccm1; |
280 | 263 | } |
281 | 264 | wusb_dev->ccm1_etd = *ccm1_etd; |
282 | - dev_info(dev, "supported encryption: %s; using %s (0x%02x/%02x)\n", | |
283 | - buf, wusb_et_name(ccm1_etd->bEncryptionType), | |
284 | - ccm1_etd->bEncryptionValue, ccm1_etd->bAuthKeyIndex); | |
265 | + dev_dbg(dev, "supported encryption: %s; using %s (0x%02x/%02x)\n", | |
266 | + buf, wusb_et_name(ccm1_etd->bEncryptionType), | |
267 | + ccm1_etd->bEncryptionValue, ccm1_etd->bAuthKeyIndex); | |
285 | 268 | result = 0; |
286 | 269 | kfree(secd_buf); |
287 | 270 | out: |
288 | - d_fnend(3, dev, "(usb_dev %p, wusb_dev %p) = %d\n", | |
289 | - usb_dev, wusb_dev, result); | |
290 | 271 | return result; |
291 | 272 | |
292 | 273 | |
... | ... | @@ -303,32 +284,6 @@ |
303 | 284 | /* Nothing so far */ |
304 | 285 | } |
305 | 286 | |
306 | -static void hs_printk(unsigned level, struct device *dev, | |
307 | - struct usb_handshake *hs) | |
308 | -{ | |
309 | - d_printf(level, dev, | |
310 | - " bMessageNumber: %u\n" | |
311 | - " bStatus: %u\n" | |
312 | - " tTKID: %02x %02x %02x\n" | |
313 | - " CDID: %02x %02x %02x %02x %02x %02x %02x %02x\n" | |
314 | - " %02x %02x %02x %02x %02x %02x %02x %02x\n" | |
315 | - " nonce: %02x %02x %02x %02x %02x %02x %02x %02x\n" | |
316 | - " %02x %02x %02x %02x %02x %02x %02x %02x\n" | |
317 | - " MIC: %02x %02x %02x %02x %02x %02x %02x %02x\n", | |
318 | - hs->bMessageNumber, hs->bStatus, | |
319 | - hs->tTKID[2], hs->tTKID[1], hs->tTKID[0], | |
320 | - hs->CDID[0], hs->CDID[1], hs->CDID[2], hs->CDID[3], | |
321 | - hs->CDID[4], hs->CDID[5], hs->CDID[6], hs->CDID[7], | |
322 | - hs->CDID[8], hs->CDID[9], hs->CDID[10], hs->CDID[11], | |
323 | - hs->CDID[12], hs->CDID[13], hs->CDID[14], hs->CDID[15], | |
324 | - hs->nonce[0], hs->nonce[1], hs->nonce[2], hs->nonce[3], | |
325 | - hs->nonce[4], hs->nonce[5], hs->nonce[6], hs->nonce[7], | |
326 | - hs->nonce[8], hs->nonce[9], hs->nonce[10], hs->nonce[11], | |
327 | - hs->nonce[12], hs->nonce[13], hs->nonce[14], hs->nonce[15], | |
328 | - hs->MIC[0], hs->MIC[1], hs->MIC[2], hs->MIC[3], | |
329 | - hs->MIC[4], hs->MIC[5], hs->MIC[6], hs->MIC[7]); | |
330 | -} | |
331 | - | |
332 | 287 | /** |
333 | 288 | * Update the address of an unauthenticated WUSB device |
334 | 289 | * |
... | ... | @@ -421,9 +376,6 @@ |
421 | 376 | get_random_bytes(&hs[0].nonce, sizeof(hs[0].nonce)); |
422 | 377 | memset(hs[0].MIC, 0, sizeof(hs[0].MIC)); /* Per WUSB1.0[T7-22] */ |
423 | 378 | |
424 | - d_printf(1, dev, "I: sending hs1:\n"); | |
425 | - hs_printk(2, dev, &hs[0]); | |
426 | - | |
427 | 379 | result = usb_control_msg( |
428 | 380 | usb_dev, usb_sndctrlpipe(usb_dev, 0), |
429 | 381 | USB_REQ_SET_HANDSHAKE, |
... | ... | @@ -444,8 +396,6 @@ |
444 | 396 | dev_err(dev, "Handshake2: request failed: %d\n", result); |
445 | 397 | goto error_hs2; |
446 | 398 | } |
447 | - d_printf(1, dev, "got HS2:\n"); | |
448 | - hs_printk(2, dev, &hs[1]); | |
449 | 399 | |
450 | 400 | result = -EINVAL; |
451 | 401 | if (hs[1].bMessageNumber != 2) { |
... | ... | @@ -486,10 +436,6 @@ |
486 | 436 | result); |
487 | 437 | goto error_hs2; |
488 | 438 | } |
489 | - d_printf(2, dev, "KCK:\n"); | |
490 | - d_dump(2, dev, keydvt_out.kck, sizeof(keydvt_out.kck)); | |
491 | - d_printf(2, dev, "PTK:\n"); | |
492 | - d_dump(2, dev, keydvt_out.ptk, sizeof(keydvt_out.ptk)); | |
493 | 439 | |
494 | 440 | /* Compute MIC and verify it */ |
495 | 441 | result = wusb_oob_mic(mic, keydvt_out.kck, &ccm_n, &hs[1]); |
... | ... | @@ -499,8 +445,6 @@ |
499 | 445 | goto error_hs2; |
500 | 446 | } |
501 | 447 | |
502 | - d_printf(2, dev, "MIC:\n"); | |
503 | - d_dump(2, dev, mic, sizeof(mic)); | |
504 | 448 | if (memcmp(hs[1].MIC, mic, sizeof(hs[1].MIC))) { |
505 | 449 | dev_err(dev, "Handshake2 failed: MIC mismatch\n"); |
506 | 450 | goto error_hs2; |
... | ... | @@ -520,9 +464,6 @@ |
520 | 464 | goto error_hs2; |
521 | 465 | } |
522 | 466 | |
523 | - d_printf(1, dev, "I: sending hs3:\n"); | |
524 | - hs_printk(2, dev, &hs[2]); | |
525 | - | |
526 | 467 | result = usb_control_msg( |
527 | 468 | usb_dev, usb_sndctrlpipe(usb_dev, 0), |
528 | 469 | USB_REQ_SET_HANDSHAKE, |
529 | 470 | |
... | ... | @@ -533,14 +474,11 @@ |
533 | 474 | goto error_hs3; |
534 | 475 | } |
535 | 476 | |
536 | - d_printf(1, dev, "I: turning on encryption on host for device\n"); | |
537 | - d_dump(2, dev, keydvt_out.ptk, sizeof(keydvt_out.ptk)); | |
538 | 477 | result = wusbhc->set_ptk(wusbhc, wusb_dev->port_idx, tkid, |
539 | 478 | keydvt_out.ptk, sizeof(keydvt_out.ptk)); |
540 | 479 | if (result < 0) |
541 | 480 | goto error_wusbhc_set_ptk; |
542 | 481 | |
543 | - d_printf(1, dev, "I: setting a GTK\n"); | |
544 | 482 | result = wusb_dev_set_gtk(wusbhc, wusb_dev); |
545 | 483 | if (result < 0) { |
546 | 484 | dev_err(dev, "Set GTK for device: request failed: %d\n", |
547 | 485 | |
... | ... | @@ -550,13 +488,12 @@ |
550 | 488 | |
551 | 489 | /* Update the device's address from unauth to auth */ |
552 | 490 | if (usb_dev->authenticated == 0) { |
553 | - d_printf(1, dev, "I: updating addres to auth from non-auth\n"); | |
554 | 491 | result = wusb_dev_update_address(wusbhc, wusb_dev); |
555 | 492 | if (result < 0) |
556 | 493 | goto error_dev_update_address; |
557 | 494 | } |
558 | 495 | result = 0; |
559 | - d_printf(1, dev, "I: 4way handshke done, device authenticated\n"); | |
496 | + dev_info(dev, "device authenticated\n"); | |
560 | 497 | |
561 | 498 | error_dev_update_address: |
562 | 499 | error_wusbhc_set_gtk: |
563 | 500 | |
... | ... | @@ -569,10 +506,8 @@ |
569 | 506 | memset(&keydvt_in, 0, sizeof(keydvt_in)); |
570 | 507 | memset(&ccm_n, 0, sizeof(ccm_n)); |
571 | 508 | memset(mic, 0, sizeof(mic)); |
572 | - if (result < 0) { | |
573 | - /* error path */ | |
509 | + if (result < 0) | |
574 | 510 | wusb_dev_set_encryption(usb_dev, 0); |
575 | - } | |
576 | 511 | error_dev_set_encryption: |
577 | 512 | kfree(hs); |
578 | 513 | error_kzalloc: |
drivers/usb/wusbcore/wa-rpipe.c
... | ... | @@ -60,13 +60,10 @@ |
60 | 60 | #include <linux/init.h> |
61 | 61 | #include <asm/atomic.h> |
62 | 62 | #include <linux/bitmap.h> |
63 | + | |
63 | 64 | #include "wusbhc.h" |
64 | 65 | #include "wa-hc.h" |
65 | 66 | |
66 | -#define D_LOCAL 0 | |
67 | -#include <linux/uwb/debug.h> | |
68 | - | |
69 | - | |
70 | 67 | static int __rpipe_get_descr(struct wahc *wa, |
71 | 68 | struct usb_rpipe_descriptor *descr, u16 index) |
72 | 69 | { |
... | ... | @@ -76,7 +73,6 @@ |
76 | 73 | /* Get the RPIPE descriptor -- we cannot use the usb_get_descriptor() |
77 | 74 | * function because the arguments are different. |
78 | 75 | */ |
79 | - d_printf(1, dev, "rpipe %u: get descr\n", index); | |
80 | 76 | result = usb_control_msg( |
81 | 77 | wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0), |
82 | 78 | USB_REQ_GET_DESCRIPTOR, |
... | ... | @@ -115,7 +111,6 @@ |
115 | 111 | /* we cannot use the usb_get_descriptor() function because the |
116 | 112 | * arguments are different. |
117 | 113 | */ |
118 | - d_printf(1, dev, "rpipe %u: set descr\n", index); | |
119 | 114 | result = usb_control_msg( |
120 | 115 | wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0), |
121 | 116 | USB_REQ_SET_DESCRIPTOR, |
122 | 117 | |
... | ... | @@ -174,13 +169,12 @@ |
174 | 169 | { |
175 | 170 | struct wa_rpipe *rpipe = container_of(_rpipe, struct wa_rpipe, refcnt); |
176 | 171 | u8 index = le16_to_cpu(rpipe->descr.wRPipeIndex); |
177 | - d_fnstart(1, NULL, "(rpipe %p %u)\n", rpipe, index); | |
172 | + | |
178 | 173 | if (rpipe->ep) |
179 | 174 | rpipe->ep->hcpriv = NULL; |
180 | 175 | rpipe_put_idx(rpipe->wa, index); |
181 | 176 | wa_put(rpipe->wa); |
182 | 177 | kfree(rpipe); |
183 | - d_fnend(1, NULL, "(rpipe %p %u)\n", rpipe, index); | |
184 | 178 | } |
185 | 179 | EXPORT_SYMBOL_GPL(rpipe_destroy); |
186 | 180 | |
... | ... | @@ -202,7 +196,6 @@ |
202 | 196 | struct wa_rpipe *rpipe; |
203 | 197 | struct device *dev = &wa->usb_iface->dev; |
204 | 198 | |
205 | - d_fnstart(3, dev, "(wa %p crs 0x%02x)\n", wa, crs); | |
206 | 199 | rpipe = kzalloc(sizeof(*rpipe), gfp); |
207 | 200 | if (rpipe == NULL) |
208 | 201 | return -ENOMEM; |
209 | 202 | |
... | ... | @@ -223,14 +216,12 @@ |
223 | 216 | } |
224 | 217 | *prpipe = NULL; |
225 | 218 | kfree(rpipe); |
226 | - d_fnend(3, dev, "(wa %p crs 0x%02x) = -ENXIO\n", wa, crs); | |
227 | 219 | return -ENXIO; |
228 | 220 | |
229 | 221 | found: |
230 | 222 | set_bit(rpipe_idx, wa->rpipe_bm); |
231 | 223 | rpipe->wa = wa_get(wa); |
232 | 224 | *prpipe = rpipe; |
233 | - d_fnstart(3, dev, "(wa %p crs 0x%02x) = 0\n", wa, crs); | |
234 | 225 | return 0; |
235 | 226 | } |
236 | 227 | |
... | ... | @@ -239,7 +230,6 @@ |
239 | 230 | int result; |
240 | 231 | struct device *dev = &wa->usb_iface->dev; |
241 | 232 | |
242 | - d_printf(1, dev, "rpipe %u: reset\n", index); | |
243 | 233 | result = usb_control_msg( |
244 | 234 | wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0), |
245 | 235 | USB_REQ_RPIPE_RESET, |
... | ... | @@ -276,7 +266,6 @@ |
276 | 266 | struct usb_descriptor_header *hdr; |
277 | 267 | struct usb_wireless_ep_comp_descriptor *epcd; |
278 | 268 | |
279 | - d_fnstart(3, dev, "(ep %p)\n", ep); | |
280 | 269 | if (ep->desc.bEndpointAddress == 0) { |
281 | 270 | epcd = &epc0; |
282 | 271 | goto out; |
... | ... | @@ -310,7 +299,6 @@ |
310 | 299 | itr_size -= hdr->bDescriptorType; |
311 | 300 | } |
312 | 301 | out: |
313 | - d_fnend(3, dev, "(ep %p) = %p\n", ep, epcd); | |
314 | 302 | return epcd; |
315 | 303 | } |
316 | 304 | |
... | ... | @@ -329,8 +317,6 @@ |
329 | 317 | struct usb_wireless_ep_comp_descriptor *epcd; |
330 | 318 | u8 unauth; |
331 | 319 | |
332 | - d_fnstart(3, dev, "(rpipe %p wa %p ep %p, urb %p)\n", | |
333 | - rpipe, wa, ep, urb); | |
334 | 320 | epcd = rpipe_epc_find(dev, ep); |
335 | 321 | if (epcd == NULL) { |
336 | 322 | dev_err(dev, "ep 0x%02x: can't find companion descriptor\n", |
... | ... | @@ -350,10 +336,12 @@ |
350 | 336 | /* FIXME: use maximum speed as supported or recommended by device */ |
351 | 337 | rpipe->descr.bSpeed = usb_pipeendpoint(urb->pipe) == 0 ? |
352 | 338 | UWB_PHY_RATE_53 : UWB_PHY_RATE_200; |
353 | - d_printf(2, dev, "addr %u (0x%02x) rpipe #%u ep# %u speed %d\n", | |
354 | - urb->dev->devnum, urb->dev->devnum | unauth, | |
355 | - le16_to_cpu(rpipe->descr.wRPipeIndex), | |
356 | - usb_pipeendpoint(urb->pipe), rpipe->descr.bSpeed); | |
339 | + | |
340 | + dev_dbg(dev, "addr %u (0x%02x) rpipe #%u ep# %u speed %d\n", | |
341 | + urb->dev->devnum, urb->dev->devnum | unauth, | |
342 | + le16_to_cpu(rpipe->descr.wRPipeIndex), | |
343 | + usb_pipeendpoint(urb->pipe), rpipe->descr.bSpeed); | |
344 | + | |
357 | 345 | /* see security.c:wusb_update_address() */ |
358 | 346 | if (unlikely(urb->dev->devnum == 0x80)) |
359 | 347 | rpipe->descr.bDeviceAddress = 0; |
... | ... | @@ -384,8 +372,6 @@ |
384 | 372 | } |
385 | 373 | result = 0; |
386 | 374 | error: |
387 | - d_fnend(3, dev, "(rpipe %p wa %p ep %p urb %p) = %d\n", | |
388 | - rpipe, wa, ep, urb, result); | |
389 | 375 | return result; |
390 | 376 | } |
391 | 377 | |
... | ... | @@ -405,8 +391,6 @@ |
405 | 391 | u8 unauth = (usb_dev->wusb && !usb_dev->authenticated) ? 0x80 : 0; |
406 | 392 | u8 portnum = wusb_port_no_to_idx(urb->dev->portnum); |
407 | 393 | |
408 | - d_fnstart(3, dev, "(rpipe %p wa %p ep %p, urb %p)\n", | |
409 | - rpipe, wa, ep, urb); | |
410 | 394 | #define AIM_CHECK(rdf, val, text) \ |
411 | 395 | do { \ |
412 | 396 | if (rpipe->descr.rdf != (val)) { \ |
... | ... | @@ -451,8 +435,6 @@ |
451 | 435 | struct wa_rpipe *rpipe; |
452 | 436 | u8 eptype; |
453 | 437 | |
454 | - d_fnstart(3, dev, "(wa %p ep %p urb %p gfp 0x%08x)\n", wa, ep, urb, | |
455 | - gfp); | |
456 | 438 | mutex_lock(&wa->rpipe_mutex); |
457 | 439 | rpipe = ep->hcpriv; |
458 | 440 | if (rpipe != NULL) { |
... | ... | @@ -462,9 +444,9 @@ |
462 | 444 | goto error; |
463 | 445 | } |
464 | 446 | __rpipe_get(rpipe); |
465 | - d_printf(2, dev, "ep 0x%02x: reusing rpipe %u\n", | |
466 | - ep->desc.bEndpointAddress, | |
467 | - le16_to_cpu(rpipe->descr.wRPipeIndex)); | |
447 | + dev_dbg(dev, "ep 0x%02x: reusing rpipe %u\n", | |
448 | + ep->desc.bEndpointAddress, | |
449 | + le16_to_cpu(rpipe->descr.wRPipeIndex)); | |
468 | 450 | } else { |
469 | 451 | /* hmm, assign idle rpipe, aim it */ |
470 | 452 | result = -ENOBUFS; |
471 | 453 | |
472 | 454 | |
... | ... | @@ -480,14 +462,12 @@ |
480 | 462 | ep->hcpriv = rpipe; |
481 | 463 | rpipe->ep = ep; |
482 | 464 | __rpipe_get(rpipe); /* for caching into ep->hcpriv */ |
483 | - d_printf(2, dev, "ep 0x%02x: using rpipe %u\n", | |
484 | - ep->desc.bEndpointAddress, | |
485 | - le16_to_cpu(rpipe->descr.wRPipeIndex)); | |
465 | + dev_dbg(dev, "ep 0x%02x: using rpipe %u\n", | |
466 | + ep->desc.bEndpointAddress, | |
467 | + le16_to_cpu(rpipe->descr.wRPipeIndex)); | |
486 | 468 | } |
487 | - d_dump(4, dev, &rpipe->descr, sizeof(rpipe->descr)); | |
488 | 469 | error: |
489 | 470 | mutex_unlock(&wa->rpipe_mutex); |
490 | - d_fnend(3, dev, "(wa %p ep %p urb %p gfp 0x%08x)\n", wa, ep, urb, gfp); | |
491 | 471 | return result; |
492 | 472 | } |
493 | 473 | |
... | ... | @@ -507,7 +487,7 @@ |
507 | 487 | void wa_rpipes_destroy(struct wahc *wa) |
508 | 488 | { |
509 | 489 | struct device *dev = &wa->usb_iface->dev; |
510 | - d_fnstart(3, dev, "(wa %p)\n", wa); | |
490 | + | |
511 | 491 | if (!bitmap_empty(wa->rpipe_bm, wa->rpipes)) { |
512 | 492 | char buf[256]; |
513 | 493 | WARN_ON(1); |
... | ... | @@ -515,7 +495,6 @@ |
515 | 495 | dev_err(dev, "BUG: pipes not released on exit: %s\n", buf); |
516 | 496 | } |
517 | 497 | kfree(wa->rpipe_bm); |
518 | - d_fnend(3, dev, "(wa %p)\n", wa); | |
519 | 498 | } |
520 | 499 | |
521 | 500 | /* |
522 | 501 | |
523 | 502 | |
524 | 503 | |
525 | 504 | |
526 | 505 | |
... | ... | @@ -530,34 +509,21 @@ |
530 | 509 | */ |
531 | 510 | void rpipe_ep_disable(struct wahc *wa, struct usb_host_endpoint *ep) |
532 | 511 | { |
533 | - struct device *dev = &wa->usb_iface->dev; | |
534 | 512 | struct wa_rpipe *rpipe; |
535 | - d_fnstart(2, dev, "(wa %p ep %p)\n", wa, ep); | |
513 | + | |
536 | 514 | mutex_lock(&wa->rpipe_mutex); |
537 | 515 | rpipe = ep->hcpriv; |
538 | 516 | if (rpipe != NULL) { |
539 | - unsigned rc = atomic_read(&rpipe->refcnt.refcount); | |
540 | - int result; | |
541 | 517 | u16 index = le16_to_cpu(rpipe->descr.wRPipeIndex); |
542 | 518 | |
543 | - if (rc != 1) | |
544 | - d_printf(1, dev, "(wa %p ep %p) rpipe %p refcnt %u\n", | |
545 | - wa, ep, rpipe, rc); | |
546 | - | |
547 | - d_printf(1, dev, "rpipe %u: abort\n", index); | |
548 | - result = usb_control_msg( | |
519 | + usb_control_msg( | |
549 | 520 | wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0), |
550 | 521 | USB_REQ_RPIPE_ABORT, |
551 | 522 | USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_RPIPE, |
552 | 523 | 0, index, NULL, 0, 1000 /* FIXME: arbitrary */); |
553 | - if (result < 0 && result != -ENODEV /* dev is gone */) | |
554 | - d_printf(1, dev, "(wa %p rpipe %u): abort failed: %d\n", | |
555 | - wa, index, result); | |
556 | 524 | rpipe_put(rpipe); |
557 | 525 | } |
558 | 526 | mutex_unlock(&wa->rpipe_mutex); |
559 | - d_fnend(2, dev, "(wa %p ep %p)\n", wa, ep); | |
560 | - return; | |
561 | 527 | } |
562 | 528 | EXPORT_SYMBOL_GPL(rpipe_ep_disable); |
drivers/usb/wusbcore/wa-xfer.c
... | ... | @@ -82,13 +82,10 @@ |
82 | 82 | #include <linux/init.h> |
83 | 83 | #include <linux/spinlock.h> |
84 | 84 | #include <linux/hash.h> |
85 | + | |
85 | 86 | #include "wa-hc.h" |
86 | 87 | #include "wusbhc.h" |
87 | 88 | |
88 | -#undef D_LOCAL | |
89 | -#define D_LOCAL 0 /* 0 disabled, > 0 different levels... */ | |
90 | -#include <linux/uwb/debug.h> | |
91 | - | |
92 | 89 | enum { |
93 | 90 | WA_SEGS_MAX = 255, |
94 | 91 | }; |
... | ... | @@ -180,7 +177,6 @@ |
180 | 177 | } |
181 | 178 | } |
182 | 179 | kfree(xfer); |
183 | - d_printf(2, NULL, "xfer %p destroyed\n", xfer); | |
184 | 180 | } |
185 | 181 | |
186 | 182 | static void wa_xfer_get(struct wa_xfer *xfer) |
187 | 183 | |
... | ... | @@ -190,10 +186,7 @@ |
190 | 186 | |
191 | 187 | static void wa_xfer_put(struct wa_xfer *xfer) |
192 | 188 | { |
193 | - d_fnstart(3, NULL, "(xfer %p) -- ref count bef put %d\n", | |
194 | - xfer, atomic_read(&xfer->refcnt.refcount)); | |
195 | 189 | kref_put(&xfer->refcnt, wa_xfer_destroy); |
196 | - d_fnend(3, NULL, "(xfer %p) = void\n", xfer); | |
197 | 190 | } |
198 | 191 | |
199 | 192 | /* |
... | ... | @@ -209,7 +202,7 @@ |
209 | 202 | static void wa_xfer_giveback(struct wa_xfer *xfer) |
210 | 203 | { |
211 | 204 | unsigned long flags; |
212 | - d_fnstart(3, NULL, "(xfer %p)\n", xfer); | |
205 | + | |
213 | 206 | spin_lock_irqsave(&xfer->wa->xfer_list_lock, flags); |
214 | 207 | list_del_init(&xfer->list_node); |
215 | 208 | spin_unlock_irqrestore(&xfer->wa->xfer_list_lock, flags); |
... | ... | @@ -217,7 +210,6 @@ |
217 | 210 | wusbhc_giveback_urb(xfer->wa->wusb, xfer->urb, xfer->result); |
218 | 211 | wa_put(xfer->wa); |
219 | 212 | wa_xfer_put(xfer); |
220 | - d_fnend(3, NULL, "(xfer %p) = void\n", xfer); | |
221 | 213 | } |
222 | 214 | |
223 | 215 | /* |
224 | 216 | |
... | ... | @@ -227,13 +219,10 @@ |
227 | 219 | */ |
228 | 220 | static void wa_xfer_completion(struct wa_xfer *xfer) |
229 | 221 | { |
230 | - d_fnstart(3, NULL, "(xfer %p)\n", xfer); | |
231 | 222 | if (xfer->wusb_dev) |
232 | 223 | wusb_dev_put(xfer->wusb_dev); |
233 | 224 | rpipe_put(xfer->ep->hcpriv); |
234 | 225 | wa_xfer_giveback(xfer); |
235 | - d_fnend(3, NULL, "(xfer %p) = void\n", xfer); | |
236 | - return; | |
237 | 226 | } |
238 | 227 | |
239 | 228 | /* |
240 | 229 | |
... | ... | @@ -243,12 +232,12 @@ |
243 | 232 | */ |
244 | 233 | static unsigned __wa_xfer_is_done(struct wa_xfer *xfer) |
245 | 234 | { |
235 | + struct device *dev = &xfer->wa->usb_iface->dev; | |
246 | 236 | unsigned result, cnt; |
247 | 237 | struct wa_seg *seg; |
248 | 238 | struct urb *urb = xfer->urb; |
249 | 239 | unsigned found_short = 0; |
250 | 240 | |
251 | - d_fnstart(3, NULL, "(xfer %p)\n", xfer); | |
252 | 241 | result = xfer->segs_done == xfer->segs_submitted; |
253 | 242 | if (result == 0) |
254 | 243 | goto out; |
... | ... | @@ -258,10 +247,8 @@ |
258 | 247 | switch (seg->status) { |
259 | 248 | case WA_SEG_DONE: |
260 | 249 | if (found_short && seg->result > 0) { |
261 | - if (printk_ratelimit()) | |
262 | - printk(KERN_ERR "xfer %p#%u: bad short " | |
263 | - "segments (%zu)\n", xfer, cnt, | |
264 | - seg->result); | |
250 | + dev_dbg(dev, "xfer %p#%u: bad short segments (%zu)\n", | |
251 | + xfer, cnt, seg->result); | |
265 | 252 | urb->status = -EINVAL; |
266 | 253 | goto out; |
267 | 254 | } |
268 | 255 | |
269 | 256 | |
270 | 257 | |
271 | 258 | |
272 | 259 | |
... | ... | @@ -269,36 +256,30 @@ |
269 | 256 | if (seg->result < xfer->seg_size |
270 | 257 | && cnt != xfer->segs-1) |
271 | 258 | found_short = 1; |
272 | - d_printf(2, NULL, "xfer %p#%u: DONE short %d " | |
273 | - "result %zu urb->actual_length %d\n", | |
274 | - xfer, seg->index, found_short, seg->result, | |
275 | - urb->actual_length); | |
259 | + dev_dbg(dev, "xfer %p#%u: DONE short %d " | |
260 | + "result %zu urb->actual_length %d\n", | |
261 | + xfer, seg->index, found_short, seg->result, | |
262 | + urb->actual_length); | |
276 | 263 | break; |
277 | 264 | case WA_SEG_ERROR: |
278 | 265 | xfer->result = seg->result; |
279 | - d_printf(2, NULL, "xfer %p#%u: ERROR result %zu\n", | |
280 | - xfer, seg->index, seg->result); | |
266 | + dev_dbg(dev, "xfer %p#%u: ERROR result %zu\n", | |
267 | + xfer, seg->index, seg->result); | |
281 | 268 | goto out; |
282 | 269 | case WA_SEG_ABORTED: |
283 | - WARN_ON(urb->status != -ECONNRESET | |
284 | - && urb->status != -ENOENT); | |
285 | - d_printf(2, NULL, "xfer %p#%u ABORTED: result %d\n", | |
286 | - xfer, seg->index, urb->status); | |
270 | + dev_dbg(dev, "xfer %p#%u ABORTED: result %d\n", | |
271 | + xfer, seg->index, urb->status); | |
287 | 272 | xfer->result = urb->status; |
288 | 273 | goto out; |
289 | 274 | default: |
290 | - /* if (printk_ratelimit()) */ | |
291 | - printk(KERN_ERR "xfer %p#%u: " | |
292 | - "is_done bad state %d\n", | |
293 | - xfer, cnt, seg->status); | |
275 | + dev_warn(dev, "xfer %p#%u: is_done bad state %d\n", | |
276 | + xfer, cnt, seg->status); | |
294 | 277 | xfer->result = -EINVAL; |
295 | - WARN_ON(1); | |
296 | 278 | goto out; |
297 | 279 | } |
298 | 280 | } |
299 | 281 | xfer->result = 0; |
300 | 282 | out: |
301 | - d_fnend(3, NULL, "(xfer %p) = void\n", xfer); | |
302 | 283 | return result; |
303 | 284 | } |
304 | 285 | |
... | ... | @@ -424,8 +405,6 @@ |
424 | 405 | struct urb *urb = xfer->urb; |
425 | 406 | struct wa_rpipe *rpipe = xfer->ep->hcpriv; |
426 | 407 | |
427 | - d_fnstart(3, dev, "(xfer %p [rpipe %p] urb %p)\n", | |
428 | - xfer, rpipe, urb); | |
429 | 408 | switch (rpipe->descr.bmAttribute & 0x3) { |
430 | 409 | case USB_ENDPOINT_XFER_CONTROL: |
431 | 410 | *pxfer_type = WA_XFER_TYPE_CTL; |
432 | 411 | |
... | ... | @@ -472,12 +451,10 @@ |
472 | 451 | if (xfer->segs == 0 && *pxfer_type == WA_XFER_TYPE_CTL) |
473 | 452 | xfer->segs = 1; |
474 | 453 | error: |
475 | - d_fnend(3, dev, "(xfer %p [rpipe %p] urb %p) = %d\n", | |
476 | - xfer, rpipe, urb, (int)result); | |
477 | 454 | return result; |
478 | 455 | } |
479 | 456 | |
480 | -/** Fill in the common request header and xfer-type specific data. */ | |
457 | +/* Fill in the common request header and xfer-type specific data. */ | |
481 | 458 | static void __wa_xfer_setup_hdr0(struct wa_xfer *xfer, |
482 | 459 | struct wa_xfer_hdr *xfer_hdr0, |
483 | 460 | enum wa_xfer_type xfer_type, |
484 | 461 | |
... | ... | @@ -534,14 +511,13 @@ |
534 | 511 | unsigned rpipe_ready = 0; |
535 | 512 | u8 done = 0; |
536 | 513 | |
537 | - d_fnstart(3, NULL, "(urb %p [%d])\n", urb, urb->status); | |
538 | 514 | switch (urb->status) { |
539 | 515 | case 0: |
540 | 516 | spin_lock_irqsave(&xfer->lock, flags); |
541 | 517 | wa = xfer->wa; |
542 | 518 | dev = &wa->usb_iface->dev; |
543 | - d_printf(2, dev, "xfer %p#%u: data out done (%d bytes)\n", | |
544 | - xfer, seg->index, urb->actual_length); | |
519 | + dev_dbg(dev, "xfer %p#%u: data out done (%d bytes)\n", | |
520 | + xfer, seg->index, urb->actual_length); | |
545 | 521 | if (seg->status < WA_SEG_PENDING) |
546 | 522 | seg->status = WA_SEG_PENDING; |
547 | 523 | seg->result = urb->actual_length; |
... | ... | @@ -555,9 +531,8 @@ |
555 | 531 | wa = xfer->wa; |
556 | 532 | dev = &wa->usb_iface->dev; |
557 | 533 | rpipe = xfer->ep->hcpriv; |
558 | - if (printk_ratelimit()) | |
559 | - dev_err(dev, "xfer %p#%u: data out error %d\n", | |
560 | - xfer, seg->index, urb->status); | |
534 | + dev_dbg(dev, "xfer %p#%u: data out error %d\n", | |
535 | + xfer, seg->index, urb->status); | |
561 | 536 | if (edc_inc(&wa->nep_edc, EDC_MAX_ERRORS, |
562 | 537 | EDC_ERROR_TIMEFRAME)){ |
563 | 538 | dev_err(dev, "DTO: URB max acceptable errors " |
... | ... | @@ -578,7 +553,6 @@ |
578 | 553 | if (rpipe_ready) |
579 | 554 | wa_xfer_delayed_run(rpipe); |
580 | 555 | } |
581 | - d_fnend(3, NULL, "(urb %p [%d]) = void\n", urb, urb->status); | |
582 | 556 | } |
583 | 557 | |
584 | 558 | /* |
585 | 559 | |
... | ... | @@ -610,14 +584,12 @@ |
610 | 584 | unsigned rpipe_ready; |
611 | 585 | u8 done = 0; |
612 | 586 | |
613 | - d_fnstart(3, NULL, "(urb %p [%d])\n", urb, urb->status); | |
614 | 587 | switch (urb->status) { |
615 | 588 | case 0: |
616 | 589 | spin_lock_irqsave(&xfer->lock, flags); |
617 | 590 | wa = xfer->wa; |
618 | 591 | dev = &wa->usb_iface->dev; |
619 | - d_printf(2, dev, "xfer %p#%u: request done\n", | |
620 | - xfer, seg->index); | |
592 | + dev_dbg(dev, "xfer %p#%u: request done\n", xfer, seg->index); | |
621 | 593 | if (xfer->is_inbound && seg->status < WA_SEG_PENDING) |
622 | 594 | seg->status = WA_SEG_PENDING; |
623 | 595 | spin_unlock_irqrestore(&xfer->lock, flags); |
... | ... | @@ -652,7 +624,6 @@ |
652 | 624 | if (rpipe_ready) |
653 | 625 | wa_xfer_delayed_run(rpipe); |
654 | 626 | } |
655 | - d_fnend(3, NULL, "(urb %p [%d]) = void\n", urb, urb->status); | |
656 | 627 | } |
657 | 628 | |
658 | 629 | /* |
... | ... | @@ -750,9 +721,6 @@ |
750 | 721 | size_t xfer_hdr_size, cnt, transfer_size; |
751 | 722 | struct wa_xfer_hdr *xfer_hdr0, *xfer_hdr; |
752 | 723 | |
753 | - d_fnstart(3, dev, "(xfer %p [rpipe %p] urb %p)\n", | |
754 | - xfer, xfer->ep->hcpriv, urb); | |
755 | - | |
756 | 724 | result = __wa_xfer_setup_sizes(xfer, &xfer_type); |
757 | 725 | if (result < 0) |
758 | 726 | goto error_setup_sizes; |
... | ... | @@ -788,8 +756,6 @@ |
788 | 756 | result = 0; |
789 | 757 | error_setup_segs: |
790 | 758 | error_setup_sizes: |
791 | - d_fnend(3, dev, "(xfer %p [rpipe %p] urb %p) = %d\n", | |
792 | - xfer, xfer->ep->hcpriv, urb, result); | |
793 | 759 | return result; |
794 | 760 | } |
795 | 761 | |
... | ... | @@ -843,9 +809,6 @@ |
843 | 809 | struct wa_xfer *xfer; |
844 | 810 | unsigned long flags; |
845 | 811 | |
846 | - d_fnstart(1, dev, "(rpipe #%d) %d segments available\n", | |
847 | - le16_to_cpu(rpipe->descr.wRPipeIndex), | |
848 | - atomic_read(&rpipe->segs_available)); | |
849 | 812 | spin_lock_irqsave(&rpipe->seg_lock, flags); |
850 | 813 | while (atomic_read(&rpipe->segs_available) > 0 |
851 | 814 | && !list_empty(&rpipe->seg_list)) { |
... | ... | @@ -854,10 +817,8 @@ |
854 | 817 | list_del(&seg->list_node); |
855 | 818 | xfer = seg->xfer; |
856 | 819 | result = __wa_seg_submit(rpipe, xfer, seg); |
857 | - d_printf(1, dev, "xfer %p#%u submitted from delayed " | |
858 | - "[%d segments available] %d\n", | |
859 | - xfer, seg->index, | |
860 | - atomic_read(&rpipe->segs_available), result); | |
820 | + dev_dbg(dev, "xfer %p#%u submitted from delayed [%d segments available] %d\n", | |
821 | + xfer, seg->index, atomic_read(&rpipe->segs_available), result); | |
861 | 822 | if (unlikely(result < 0)) { |
862 | 823 | spin_unlock_irqrestore(&rpipe->seg_lock, flags); |
863 | 824 | spin_lock_irqsave(&xfer->lock, flags); |
... | ... | @@ -868,10 +829,6 @@ |
868 | 829 | } |
869 | 830 | } |
870 | 831 | spin_unlock_irqrestore(&rpipe->seg_lock, flags); |
871 | - d_fnend(1, dev, "(rpipe #%d) = void, %d segments available\n", | |
872 | - le16_to_cpu(rpipe->descr.wRPipeIndex), | |
873 | - atomic_read(&rpipe->segs_available)); | |
874 | - | |
875 | 832 | } |
876 | 833 | |
877 | 834 | /* |
... | ... | @@ -894,9 +851,6 @@ |
894 | 851 | u8 available; |
895 | 852 | u8 empty; |
896 | 853 | |
897 | - d_fnstart(3, dev, "(xfer %p [rpipe %p])\n", | |
898 | - xfer, xfer->ep->hcpriv); | |
899 | - | |
900 | 854 | spin_lock_irqsave(&wa->xfer_list_lock, flags); |
901 | 855 | list_add_tail(&xfer->list_node, &wa->xfer_list); |
902 | 856 | spin_unlock_irqrestore(&wa->xfer_list_lock, flags); |
903 | 857 | |
904 | 858 | |
905 | 859 | |
906 | 860 | |
907 | 861 | |
908 | 862 | |
... | ... | @@ -908,30 +862,24 @@ |
908 | 862 | available = atomic_read(&rpipe->segs_available); |
909 | 863 | empty = list_empty(&rpipe->seg_list); |
910 | 864 | seg = xfer->seg[cnt]; |
911 | - d_printf(2, dev, "xfer %p#%u: available %u empty %u (%s)\n", | |
912 | - xfer, cnt, available, empty, | |
913 | - available == 0 || !empty ? "delayed" : "submitted"); | |
865 | + dev_dbg(dev, "xfer %p#%u: available %u empty %u (%s)\n", | |
866 | + xfer, cnt, available, empty, | |
867 | + available == 0 || !empty ? "delayed" : "submitted"); | |
914 | 868 | if (available == 0 || !empty) { |
915 | - d_printf(1, dev, "xfer %p#%u: delayed\n", xfer, cnt); | |
869 | + dev_dbg(dev, "xfer %p#%u: delayed\n", xfer, cnt); | |
916 | 870 | seg->status = WA_SEG_DELAYED; |
917 | 871 | list_add_tail(&seg->list_node, &rpipe->seg_list); |
918 | 872 | } else { |
919 | 873 | result = __wa_seg_submit(rpipe, xfer, seg); |
920 | - if (result < 0) | |
874 | + if (result < 0) { | |
875 | + __wa_xfer_abort(xfer); | |
921 | 876 | goto error_seg_submit; |
877 | + } | |
922 | 878 | } |
923 | 879 | xfer->segs_submitted++; |
924 | 880 | } |
925 | - spin_unlock_irqrestore(&rpipe->seg_lock, flags); | |
926 | - d_fnend(3, dev, "(xfer %p [rpipe %p]) = void\n", xfer, | |
927 | - xfer->ep->hcpriv); | |
928 | - return result; | |
929 | - | |
930 | 881 | error_seg_submit: |
931 | - __wa_xfer_abort(xfer); | |
932 | 882 | spin_unlock_irqrestore(&rpipe->seg_lock, flags); |
933 | - d_fnend(3, dev, "(xfer %p [rpipe %p]) = void\n", xfer, | |
934 | - xfer->ep->hcpriv); | |
935 | 883 | return result; |
936 | 884 | } |
937 | 885 | |
938 | 886 | |
... | ... | @@ -964,11 +912,9 @@ |
964 | 912 | struct urb *urb = xfer->urb; |
965 | 913 | struct wahc *wa = xfer->wa; |
966 | 914 | struct wusbhc *wusbhc = wa->wusb; |
967 | - struct device *dev = &wa->usb_iface->dev; | |
968 | 915 | struct wusb_dev *wusb_dev; |
969 | 916 | unsigned done; |
970 | 917 | |
971 | - d_fnstart(3, dev, "(wa %p urb %p)\n", wa, urb); | |
972 | 918 | result = rpipe_get_by_ep(wa, xfer->ep, urb, xfer->gfp); |
973 | 919 | if (result < 0) |
974 | 920 | goto error_rpipe_get; |
... | ... | @@ -997,7 +943,6 @@ |
997 | 943 | if (result < 0) |
998 | 944 | goto error_xfer_submit; |
999 | 945 | spin_unlock_irqrestore(&xfer->lock, flags); |
1000 | - d_fnend(3, dev, "(wa %p urb %p) = void\n", wa, urb); | |
1001 | 946 | return; |
1002 | 947 | |
1003 | 948 | /* this is basically wa_xfer_completion() broken up wa_xfer_giveback() |
... | ... | @@ -1015,7 +960,6 @@ |
1015 | 960 | error_rpipe_get: |
1016 | 961 | xfer->result = result; |
1017 | 962 | wa_xfer_giveback(xfer); |
1018 | - d_fnend(3, dev, "(wa %p urb %p) = (void) %d\n", wa, urb, result); | |
1019 | 963 | return; |
1020 | 964 | |
1021 | 965 | error_xfer_submit: |
... | ... | @@ -1024,8 +968,6 @@ |
1024 | 968 | spin_unlock_irqrestore(&xfer->lock, flags); |
1025 | 969 | if (done) |
1026 | 970 | wa_xfer_completion(xfer); |
1027 | - d_fnend(3, dev, "(wa %p urb %p) = (void) %d\n", wa, urb, result); | |
1028 | - return; | |
1029 | 971 | } |
1030 | 972 | |
1031 | 973 | /* |
1032 | 974 | |
... | ... | @@ -1041,11 +983,9 @@ |
1041 | 983 | void wa_urb_enqueue_run(struct work_struct *ws) |
1042 | 984 | { |
1043 | 985 | struct wahc *wa = container_of(ws, struct wahc, xfer_work); |
1044 | - struct device *dev = &wa->usb_iface->dev; | |
1045 | 986 | struct wa_xfer *xfer, *next; |
1046 | 987 | struct urb *urb; |
1047 | 988 | |
1048 | - d_fnstart(3, dev, "(wa %p)\n", wa); | |
1049 | 989 | spin_lock_irq(&wa->xfer_list_lock); |
1050 | 990 | list_for_each_entry_safe(xfer, next, &wa->xfer_delayed_list, |
1051 | 991 | list_node) { |
... | ... | @@ -1059,7 +999,6 @@ |
1059 | 999 | spin_lock_irq(&wa->xfer_list_lock); |
1060 | 1000 | } |
1061 | 1001 | spin_unlock_irq(&wa->xfer_list_lock); |
1062 | - d_fnend(3, dev, "(wa %p) = void\n", wa); | |
1063 | 1002 | } |
1064 | 1003 | EXPORT_SYMBOL_GPL(wa_urb_enqueue_run); |
1065 | 1004 | |
... | ... | @@ -1084,9 +1023,6 @@ |
1084 | 1023 | unsigned long my_flags; |
1085 | 1024 | unsigned cant_sleep = irqs_disabled() | in_atomic(); |
1086 | 1025 | |
1087 | - d_fnstart(3, dev, "(wa %p ep %p urb %p [%d] gfp 0x%x)\n", | |
1088 | - wa, ep, urb, urb->transfer_buffer_length, gfp); | |
1089 | - | |
1090 | 1026 | if (urb->transfer_buffer == NULL |
1091 | 1027 | && !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) |
1092 | 1028 | && urb->transfer_buffer_length != 0) { |
... | ... | @@ -1108,11 +1044,13 @@ |
1108 | 1044 | xfer->gfp = gfp; |
1109 | 1045 | xfer->ep = ep; |
1110 | 1046 | urb->hcpriv = xfer; |
1111 | - d_printf(2, dev, "xfer %p urb %p pipe 0x%02x [%d bytes] %s %s %s\n", | |
1112 | - xfer, urb, urb->pipe, urb->transfer_buffer_length, | |
1113 | - urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP ? "dma" : "nodma", | |
1114 | - urb->pipe & USB_DIR_IN ? "inbound" : "outbound", | |
1115 | - cant_sleep ? "deferred" : "inline"); | |
1047 | + | |
1048 | + dev_dbg(dev, "xfer %p urb %p pipe 0x%02x [%d bytes] %s %s %s\n", | |
1049 | + xfer, urb, urb->pipe, urb->transfer_buffer_length, | |
1050 | + urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP ? "dma" : "nodma", | |
1051 | + urb->pipe & USB_DIR_IN ? "inbound" : "outbound", | |
1052 | + cant_sleep ? "deferred" : "inline"); | |
1053 | + | |
1116 | 1054 | if (cant_sleep) { |
1117 | 1055 | usb_get_urb(urb); |
1118 | 1056 | spin_lock_irqsave(&wa->xfer_list_lock, my_flags); |
1119 | 1057 | |
... | ... | @@ -1122,15 +1060,11 @@ |
1122 | 1060 | } else { |
1123 | 1061 | wa_urb_enqueue_b(xfer); |
1124 | 1062 | } |
1125 | - d_fnend(3, dev, "(wa %p ep %p urb %p [%d] gfp 0x%x) = 0\n", | |
1126 | - wa, ep, urb, urb->transfer_buffer_length, gfp); | |
1127 | 1063 | return 0; |
1128 | 1064 | |
1129 | 1065 | error_dequeued: |
1130 | 1066 | kfree(xfer); |
1131 | 1067 | error_kmalloc: |
1132 | - d_fnend(3, dev, "(wa %p ep %p urb %p [%d] gfp 0x%x) = %d\n", | |
1133 | - wa, ep, urb, urb->transfer_buffer_length, gfp, result); | |
1134 | 1068 | return result; |
1135 | 1069 | } |
1136 | 1070 | EXPORT_SYMBOL_GPL(wa_urb_enqueue); |
... | ... | @@ -1155,7 +1089,6 @@ |
1155 | 1089 | */ |
1156 | 1090 | int wa_urb_dequeue(struct wahc *wa, struct urb *urb) |
1157 | 1091 | { |
1158 | - struct device *dev = &wa->usb_iface->dev; | |
1159 | 1092 | unsigned long flags, flags2; |
1160 | 1093 | struct wa_xfer *xfer; |
1161 | 1094 | struct wa_seg *seg; |
... | ... | @@ -1163,9 +1096,6 @@ |
1163 | 1096 | unsigned cnt; |
1164 | 1097 | unsigned rpipe_ready = 0; |
1165 | 1098 | |
1166 | - d_fnstart(3, dev, "(wa %p, urb %p)\n", wa, urb); | |
1167 | - | |
1168 | - d_printf(1, dev, "xfer %p urb %p: aborting\n", urb->hcpriv, urb); | |
1169 | 1099 | xfer = urb->hcpriv; |
1170 | 1100 | if (xfer == NULL) { |
1171 | 1101 | /* NOthing setup yet enqueue will see urb->status != |
1172 | 1102 | |
... | ... | @@ -1234,13 +1164,11 @@ |
1234 | 1164 | wa_xfer_completion(xfer); |
1235 | 1165 | if (rpipe_ready) |
1236 | 1166 | wa_xfer_delayed_run(rpipe); |
1237 | - d_fnend(3, dev, "(wa %p, urb %p) = 0\n", wa, urb); | |
1238 | 1167 | return 0; |
1239 | 1168 | |
1240 | 1169 | out_unlock: |
1241 | 1170 | spin_unlock_irqrestore(&xfer->lock, flags); |
1242 | 1171 | out: |
1243 | - d_fnend(3, dev, "(wa %p, urb %p) = 0\n", wa, urb); | |
1244 | 1172 | return 0; |
1245 | 1173 | |
1246 | 1174 | dequeue_delayed: |
... | ... | @@ -1250,7 +1178,6 @@ |
1250 | 1178 | spin_unlock_irqrestore(&xfer->lock, flags); |
1251 | 1179 | wa_xfer_giveback(xfer); |
1252 | 1180 | usb_put_urb(urb); /* we got a ref in enqueue() */ |
1253 | - d_fnend(3, dev, "(wa %p, urb %p) = 0\n", wa, urb); | |
1254 | 1181 | return 0; |
1255 | 1182 | } |
1256 | 1183 | EXPORT_SYMBOL_GPL(wa_urb_dequeue); |
... | ... | @@ -1326,7 +1253,6 @@ |
1326 | 1253 | u8 usb_status; |
1327 | 1254 | unsigned rpipe_ready = 0; |
1328 | 1255 | |
1329 | - d_fnstart(3, dev, "(wa %p xfer %p)\n", wa, xfer); | |
1330 | 1256 | spin_lock_irqsave(&xfer->lock, flags); |
1331 | 1257 | seg_idx = xfer_result->bTransferSegment & 0x7f; |
1332 | 1258 | if (unlikely(seg_idx >= xfer->segs)) |
... | ... | @@ -1334,8 +1260,8 @@ |
1334 | 1260 | seg = xfer->seg[seg_idx]; |
1335 | 1261 | rpipe = xfer->ep->hcpriv; |
1336 | 1262 | usb_status = xfer_result->bTransferStatus; |
1337 | - d_printf(2, dev, "xfer %p#%u: bTransferStatus 0x%02x (seg %u)\n", | |
1338 | - xfer, seg_idx, usb_status, seg->status); | |
1263 | + dev_dbg(dev, "xfer %p#%u: bTransferStatus 0x%02x (seg %u)\n", | |
1264 | + xfer, seg_idx, usb_status, seg->status); | |
1339 | 1265 | if (seg->status == WA_SEG_ABORTED |
1340 | 1266 | || seg->status == WA_SEG_ERROR) /* already handled */ |
1341 | 1267 | goto segment_aborted; |
1342 | 1268 | |
... | ... | @@ -1391,10 +1317,8 @@ |
1391 | 1317 | wa_xfer_completion(xfer); |
1392 | 1318 | if (rpipe_ready) |
1393 | 1319 | wa_xfer_delayed_run(rpipe); |
1394 | - d_fnend(3, dev, "(wa %p xfer %p) = void\n", wa, xfer); | |
1395 | 1320 | return; |
1396 | 1321 | |
1397 | - | |
1398 | 1322 | error_submit_buf_in: |
1399 | 1323 | if (edc_inc(&wa->dti_edc, EDC_MAX_ERRORS, EDC_ERROR_TIMEFRAME)) { |
1400 | 1324 | dev_err(dev, "DTI: URB max acceptable errors " |
1401 | 1325 | |
... | ... | @@ -1416,11 +1340,8 @@ |
1416 | 1340 | wa_xfer_completion(xfer); |
1417 | 1341 | if (rpipe_ready) |
1418 | 1342 | wa_xfer_delayed_run(rpipe); |
1419 | - d_fnend(3, dev, "(wa %p xfer %p) = void [segment/DTI-submit error]\n", | |
1420 | - wa, xfer); | |
1421 | 1343 | return; |
1422 | 1344 | |
1423 | - | |
1424 | 1345 | error_bad_seg: |
1425 | 1346 | spin_unlock_irqrestore(&xfer->lock, flags); |
1426 | 1347 | wa_urb_dequeue(wa, xfer->urb); |
1427 | 1348 | |
1428 | 1349 | |
... | ... | @@ -1431,17 +1352,11 @@ |
1431 | 1352 | "exceeded, resetting device\n"); |
1432 | 1353 | wa_reset_all(wa); |
1433 | 1354 | } |
1434 | - d_fnend(3, dev, "(wa %p xfer %p) = void [bad seg]\n", wa, xfer); | |
1435 | 1355 | return; |
1436 | 1356 | |
1437 | - | |
1438 | 1357 | segment_aborted: |
1439 | 1358 | /* nothing to do, as the aborter did the completion */ |
1440 | 1359 | spin_unlock_irqrestore(&xfer->lock, flags); |
1441 | - d_fnend(3, dev, "(wa %p xfer %p) = void [segment aborted]\n", | |
1442 | - wa, xfer); | |
1443 | - return; | |
1444 | - | |
1445 | 1360 | } |
1446 | 1361 | |
1447 | 1362 | /* |
1448 | 1363 | |
... | ... | @@ -1465,15 +1380,14 @@ |
1465 | 1380 | unsigned long flags; |
1466 | 1381 | u8 done = 0; |
1467 | 1382 | |
1468 | - d_fnstart(3, NULL, "(urb %p [%d])\n", urb, urb->status); | |
1469 | 1383 | switch (urb->status) { |
1470 | 1384 | case 0: |
1471 | 1385 | spin_lock_irqsave(&xfer->lock, flags); |
1472 | 1386 | wa = xfer->wa; |
1473 | 1387 | dev = &wa->usb_iface->dev; |
1474 | 1388 | rpipe = xfer->ep->hcpriv; |
1475 | - d_printf(2, dev, "xfer %p#%u: data in done (%zu bytes)\n", | |
1476 | - xfer, seg->index, (size_t)urb->actual_length); | |
1389 | + dev_dbg(dev, "xfer %p#%u: data in done (%zu bytes)\n", | |
1390 | + xfer, seg->index, (size_t)urb->actual_length); | |
1477 | 1391 | seg->status = WA_SEG_DONE; |
1478 | 1392 | seg->result = urb->actual_length; |
1479 | 1393 | xfer->segs_done++; |
... | ... | @@ -1514,7 +1428,6 @@ |
1514 | 1428 | if (rpipe_ready) |
1515 | 1429 | wa_xfer_delayed_run(rpipe); |
1516 | 1430 | } |
1517 | - d_fnend(3, NULL, "(urb %p [%d]) = void\n", urb, urb->status); | |
1518 | 1431 | } |
1519 | 1432 | |
1520 | 1433 | /* |
1521 | 1434 | |
... | ... | @@ -1553,14 +1466,12 @@ |
1553 | 1466 | struct wa_xfer *xfer; |
1554 | 1467 | u8 usb_status; |
1555 | 1468 | |
1556 | - d_fnstart(3, dev, "(%p)\n", wa); | |
1557 | 1469 | BUG_ON(wa->dti_urb != urb); |
1558 | 1470 | switch (wa->dti_urb->status) { |
1559 | 1471 | case 0: |
1560 | 1472 | /* We have a xfer result buffer; check it */ |
1561 | - d_printf(2, dev, "DTI: xfer result %d bytes at %p\n", | |
1562 | - urb->actual_length, urb->transfer_buffer); | |
1563 | - d_dump(3, dev, urb->transfer_buffer, urb->actual_length); | |
1473 | + dev_dbg(dev, "DTI: xfer result %d bytes at %p\n", | |
1474 | + urb->actual_length, urb->transfer_buffer); | |
1564 | 1475 | if (wa->dti_urb->actual_length != sizeof(*xfer_result)) { |
1565 | 1476 | dev_err(dev, "DTI Error: xfer result--bad size " |
1566 | 1477 | "xfer result (%d bytes vs %zu needed)\n", |
... | ... | @@ -1622,7 +1533,6 @@ |
1622 | 1533 | wa_reset_all(wa); |
1623 | 1534 | } |
1624 | 1535 | out: |
1625 | - d_fnend(3, dev, "(%p) = void\n", wa); | |
1626 | 1536 | return; |
1627 | 1537 | } |
1628 | 1538 | |
... | ... | @@ -1653,7 +1563,6 @@ |
1653 | 1563 | struct wa_notif_xfer *notif_xfer; |
1654 | 1564 | const struct usb_endpoint_descriptor *dti_epd = wa->dti_epd; |
1655 | 1565 | |
1656 | - d_fnstart(4, dev, "(%p, %p)\n", wa, notif_hdr); | |
1657 | 1566 | notif_xfer = container_of(notif_hdr, struct wa_notif_xfer, hdr); |
1658 | 1567 | BUG_ON(notif_hdr->bNotifyType != WA_NOTIF_TRANSFER); |
1659 | 1568 | |
... | ... | @@ -1693,7 +1602,6 @@ |
1693 | 1602 | goto error_dti_urb_submit; |
1694 | 1603 | } |
1695 | 1604 | out: |
1696 | - d_fnend(4, dev, "(%p, %p) = void\n", wa, notif_hdr); | |
1697 | 1605 | return; |
1698 | 1606 | |
1699 | 1607 | error_dti_urb_submit: |
... | ... | @@ -1704,7 +1612,5 @@ |
1704 | 1612 | error_dti_urb_alloc: |
1705 | 1613 | error: |
1706 | 1614 | wa_reset_all(wa); |
1707 | - d_fnend(4, dev, "(%p, %p) = void\n", wa, notif_hdr); | |
1708 | - return; | |
1709 | 1615 | } |
drivers/uwb/beacon.c
... | ... | @@ -22,19 +22,16 @@ |
22 | 22 | * |
23 | 23 | * FIXME: docs |
24 | 24 | */ |
25 | - | |
26 | 25 | #include <linux/kernel.h> |
27 | 26 | #include <linux/init.h> |
28 | 27 | #include <linux/module.h> |
29 | 28 | #include <linux/device.h> |
30 | 29 | #include <linux/err.h> |
31 | 30 | #include <linux/kdev_t.h> |
31 | + | |
32 | 32 | #include "uwb-internal.h" |
33 | 33 | |
34 | -#define D_LOCAL 0 | |
35 | -#include <linux/uwb/debug.h> | |
36 | - | |
37 | -/** Start Beaconing command structure */ | |
34 | +/* Start Beaconing command structure */ | |
38 | 35 | struct uwb_rc_cmd_start_beacon { |
39 | 36 | struct uwb_rccb rccb; |
40 | 37 | __le16 wBPSTOffset; |
... | ... | @@ -176,9 +173,6 @@ |
176 | 173 | { |
177 | 174 | struct uwb_beca_e *bce, *next; |
178 | 175 | list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) { |
179 | - d_printf(6, NULL, "looking for addr %02x:%02x in %02x:%02x\n", | |
180 | - dev_addr->data[0], dev_addr->data[1], | |
181 | - bce->dev_addr.data[0], bce->dev_addr.data[1]); | |
182 | 176 | if (!memcmp(&bce->dev_addr, dev_addr, sizeof(bce->dev_addr))) |
183 | 177 | goto out; |
184 | 178 | } |
drivers/uwb/est.c
... | ... | @@ -40,11 +40,9 @@ |
40 | 40 | * uwb_est_get_size() |
41 | 41 | */ |
42 | 42 | #include <linux/spinlock.h> |
43 | -#define D_LOCAL 0 | |
44 | -#include <linux/uwb/debug.h> | |
43 | + | |
45 | 44 | #include "uwb-internal.h" |
46 | 45 | |
47 | - | |
48 | 46 | struct uwb_est { |
49 | 47 | u16 type_event_high; |
50 | 48 | u16 vendor, product; |
... | ... | @@ -52,7 +50,6 @@ |
52 | 50 | const struct uwb_est_entry *entry; |
53 | 51 | }; |
54 | 52 | |
55 | - | |
56 | 53 | static struct uwb_est *uwb_est; |
57 | 54 | static u8 uwb_est_size; |
58 | 55 | static u8 uwb_est_used; |
59 | 56 | |
... | ... | @@ -440,21 +437,12 @@ |
440 | 437 | u8 *ptr = (u8 *) rceb; |
441 | 438 | |
442 | 439 | read_lock_irqsave(&uwb_est_lock, flags); |
443 | - d_printf(2, dev, "Size query for event 0x%02x/%04x/%02x," | |
444 | - " buffer size %ld\n", | |
445 | - (unsigned) rceb->bEventType, | |
446 | - (unsigned) le16_to_cpu(rceb->wEvent), | |
447 | - (unsigned) rceb->bEventContext, | |
448 | - (long) rceb_size); | |
449 | 440 | size = -ENOSPC; |
450 | 441 | if (rceb_size < sizeof(*rceb)) |
451 | 442 | goto out; |
452 | 443 | event = le16_to_cpu(rceb->wEvent); |
453 | 444 | type_event_high = rceb->bEventType << 8 | (event & 0xff00) >> 8; |
454 | 445 | for (itr = 0; itr < uwb_est_used; itr++) { |
455 | - d_printf(3, dev, "Checking EST 0x%04x/%04x/%04x\n", | |
456 | - uwb_est[itr].type_event_high, uwb_est[itr].vendor, | |
457 | - uwb_est[itr].product); | |
458 | 446 | if (uwb_est[itr].type_event_high != type_event_high) |
459 | 447 | continue; |
460 | 448 | size = uwb_est_get_size(rc, &uwb_est[itr], |
drivers/uwb/hwa-rc.c
... | ... | @@ -57,9 +57,8 @@ |
57 | 57 | #include <linux/usb/wusb.h> |
58 | 58 | #include <linux/usb/wusb-wa.h> |
59 | 59 | #include <linux/uwb.h> |
60 | + | |
60 | 61 | #include "uwb-internal.h" |
61 | -#define D_LOCAL 1 | |
62 | -#include <linux/uwb/debug.h> | |
63 | 62 | |
64 | 63 | /* The device uses commands and events from the WHCI specification, although |
65 | 64 | * reporting itself as WUSB compliant. */ |
66 | 65 | |
67 | 66 | |
... | ... | @@ -630,17 +629,13 @@ |
630 | 629 | |
631 | 630 | switch (result = urb->status) { |
632 | 631 | case 0: |
633 | - d_printf(3, dev, "NEEP: receive stat %d, %zu bytes\n", | |
634 | - urb->status, (size_t)urb->actual_length); | |
635 | 632 | uwb_rc_neh_grok(hwarc->uwb_rc, urb->transfer_buffer, |
636 | 633 | urb->actual_length); |
637 | 634 | break; |
638 | 635 | case -ECONNRESET: /* Not an error, but a controlled situation; */ |
639 | 636 | case -ENOENT: /* (we killed the URB)...so, no broadcast */ |
640 | - d_printf(2, dev, "NEEP: URB reset/noent %d\n", urb->status); | |
641 | 637 | goto out; |
642 | 638 | case -ESHUTDOWN: /* going away! */ |
643 | - d_printf(2, dev, "NEEP: URB down %d\n", urb->status); | |
644 | 639 | goto out; |
645 | 640 | default: /* On general errors, retry unless it gets ugly */ |
646 | 641 | if (edc_inc(&hwarc->neep_edc, EDC_MAX_ERRORS, |
... | ... | @@ -649,7 +644,6 @@ |
649 | 644 | dev_err(dev, "NEEP: URB error %d\n", urb->status); |
650 | 645 | } |
651 | 646 | result = usb_submit_urb(urb, GFP_ATOMIC); |
652 | - d_printf(3, dev, "NEEP: submit %d\n", result); | |
653 | 647 | if (result < 0) { |
654 | 648 | dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n", |
655 | 649 | result); |
... | ... | @@ -758,11 +752,11 @@ |
758 | 752 | itr_size = le16_to_cpu(usb_dev->actconfig->desc.wTotalLength); |
759 | 753 | while (itr_size >= sizeof(*hdr)) { |
760 | 754 | hdr = (struct usb_descriptor_header *) itr; |
761 | - d_printf(3, dev, "Extra device descriptor: " | |
762 | - "type %02x/%u bytes @ %zu (%zu left)\n", | |
763 | - hdr->bDescriptorType, hdr->bLength, | |
764 | - (itr - usb_dev->rawdescriptors[actconfig_idx]), | |
765 | - itr_size); | |
755 | + dev_dbg(dev, "Extra device descriptor: " | |
756 | + "type %02x/%u bytes @ %zu (%zu left)\n", | |
757 | + hdr->bDescriptorType, hdr->bLength, | |
758 | + (itr - usb_dev->rawdescriptors[actconfig_idx]), | |
759 | + itr_size); | |
766 | 760 | if (hdr->bDescriptorType == USB_DT_CS_RADIO_CONTROL) |
767 | 761 | goto found; |
768 | 762 | itr += hdr->bLength; |
... | ... | @@ -794,8 +788,7 @@ |
794 | 788 | goto error; |
795 | 789 | } |
796 | 790 | rc->version = version; |
797 | - d_printf(3, dev, "Device supports WUSB protocol version 0x%04x \n", | |
798 | - rc->version); | |
791 | + dev_dbg(dev, "Device supports WUSB protocol version 0x%04x \n", rc->version); | |
799 | 792 | result = 0; |
800 | 793 | error: |
801 | 794 | return result; |
... | ... | @@ -876,7 +869,6 @@ |
876 | 869 | uwb_rc_rm(uwb_rc); |
877 | 870 | usb_put_intf(hwarc->usb_iface); |
878 | 871 | usb_put_dev(hwarc->usb_dev); |
879 | - d_printf(1, &hwarc->usb_iface->dev, "freed hwarc %p\n", hwarc); | |
880 | 872 | kfree(hwarc); |
881 | 873 | uwb_rc_put(uwb_rc); /* when creating the device, refcount = 1 */ |
882 | 874 | } |
... | ... | @@ -924,13 +916,7 @@ |
924 | 916 | |
925 | 917 | static int __init hwarc_driver_init(void) |
926 | 918 | { |
927 | - int result; | |
928 | - result = usb_register(&hwarc_driver); | |
929 | - if (result < 0) | |
930 | - printk(KERN_ERR "HWA-RC: Cannot register USB driver: %d\n", | |
931 | - result); | |
932 | - return result; | |
933 | - | |
919 | + return usb_register(&hwarc_driver); | |
934 | 920 | } |
935 | 921 | module_init(hwarc_driver_init); |
936 | 922 |
drivers/uwb/i1480/dfu/dfu.c
... | ... | @@ -34,10 +34,7 @@ |
34 | 34 | #include <linux/uwb.h> |
35 | 35 | #include <linux/random.h> |
36 | 36 | |
37 | -#define D_LOCAL 0 | |
38 | -#include <linux/uwb/debug.h> | |
39 | - | |
40 | -/** | |
37 | +/* | |
41 | 38 | * i1480_rceb_check - Check RCEB for expected field values |
42 | 39 | * @i1480: pointer to device for which RCEB is being checked |
43 | 40 | * @rceb: RCEB being checked |
... | ... | @@ -83,7 +80,7 @@ |
83 | 80 | EXPORT_SYMBOL_GPL(i1480_rceb_check); |
84 | 81 | |
85 | 82 | |
86 | -/** | |
83 | +/* | |
87 | 84 | * Execute a Radio Control Command |
88 | 85 | * |
89 | 86 | * Command data has to be in i1480->cmd_buf. |
... | ... | @@ -101,7 +98,6 @@ |
101 | 98 | u8 expected_type = reply->bEventType; |
102 | 99 | u8 context; |
103 | 100 | |
104 | - d_fnstart(3, i1480->dev, "(%p, %s, %zu)\n", i1480, cmd_name, cmd_size); | |
105 | 101 | init_completion(&i1480->evt_complete); |
106 | 102 | i1480->evt_result = -EINPROGRESS; |
107 | 103 | do { |
... | ... | @@ -150,8 +146,6 @@ |
150 | 146 | result = i1480_rceb_check(i1480, i1480->evt_buf, cmd_name, context, |
151 | 147 | expected_type, expected_event); |
152 | 148 | error: |
153 | - d_fnend(3, i1480->dev, "(%p, %s, %zu) = %zd\n", | |
154 | - i1480, cmd_name, cmd_size, result); | |
155 | 149 | return result; |
156 | 150 | } |
157 | 151 | EXPORT_SYMBOL_GPL(i1480_cmd); |
drivers/uwb/i1480/dfu/mac.c
... | ... | @@ -31,9 +31,6 @@ |
31 | 31 | #include <linux/uwb.h> |
32 | 32 | #include "i1480-dfu.h" |
33 | 33 | |
34 | -#define D_LOCAL 0 | |
35 | -#include <linux/uwb/debug.h> | |
36 | - | |
37 | 34 | /* |
38 | 35 | * Descriptor for a continuous segment of MAC fw data |
39 | 36 | */ |
... | ... | @@ -184,10 +181,6 @@ |
184 | 181 | } |
185 | 182 | if (memcmp(i1480->cmd_buf, bin + src_itr, result)) { |
186 | 183 | u8 *buf = i1480->cmd_buf; |
187 | - d_printf(2, i1480->dev, | |
188 | - "original data @ %p + %u, %zu bytes\n", | |
189 | - bin, src_itr, result); | |
190 | - d_dump(4, i1480->dev, bin + src_itr, result); | |
191 | 184 | for (cnt = 0; cnt < result; cnt++) |
192 | 185 | if (bin[src_itr + cnt] != buf[cnt]) { |
193 | 186 | dev_err(i1480->dev, "byte failed at " |
... | ... | @@ -224,7 +217,6 @@ |
224 | 217 | struct fw_hdr *hdr_itr; |
225 | 218 | int verif_retry_count; |
226 | 219 | |
227 | - d_fnstart(3, dev, "(%p, %p)\n", i1480, hdr); | |
228 | 220 | /* Now, header by header, push them to the hw */ |
229 | 221 | for (hdr_itr = hdr; hdr_itr != NULL; hdr_itr = hdr_itr->next) { |
230 | 222 | verif_retry_count = 0; |
... | ... | @@ -264,7 +256,6 @@ |
264 | 256 | break; |
265 | 257 | } |
266 | 258 | } |
267 | - d_fnend(3, dev, "(%zd)\n", result); | |
268 | 259 | return result; |
269 | 260 | } |
270 | 261 | |
271 | 262 | |
... | ... | @@ -337,11 +328,9 @@ |
337 | 328 | const struct firmware *fw; |
338 | 329 | struct fw_hdr *fw_hdrs; |
339 | 330 | |
340 | - d_fnstart(3, i1480->dev, "(%p, %s, %s)\n", i1480, fw_name, fw_tag); | |
341 | 331 | result = request_firmware(&fw, fw_name, i1480->dev); |
342 | 332 | if (result < 0) /* Up to caller to complain on -ENOENT */ |
343 | 333 | goto out; |
344 | - d_printf(3, i1480->dev, "%s fw '%s': uploading\n", fw_tag, fw_name); | |
345 | 334 | result = fw_hdrs_load(i1480, &fw_hdrs, fw->data, fw->size); |
346 | 335 | if (result < 0) { |
347 | 336 | dev_err(i1480->dev, "%s fw '%s': failed to parse firmware " |
... | ... | @@ -363,8 +352,6 @@ |
363 | 352 | out_release: |
364 | 353 | release_firmware(fw); |
365 | 354 | out: |
366 | - d_fnend(3, i1480->dev, "(%p, %s, %s) = %d\n", i1480, fw_name, fw_tag, | |
367 | - result); | |
368 | 355 | return result; |
369 | 356 | } |
370 | 357 | |
... | ... | @@ -433,7 +420,6 @@ |
433 | 420 | int result; |
434 | 421 | u32 *val = (u32 *) i1480->cmd_buf; |
435 | 422 | |
436 | - d_fnstart(3, i1480->dev, "(i1480 %p)\n", i1480); | |
437 | 423 | for (cnt = 0; cnt < 10; cnt++) { |
438 | 424 | msleep(100); |
439 | 425 | result = i1480->read(i1480, 0x80080000, 4); |
... | ... | @@ -447,7 +433,6 @@ |
447 | 433 | dev_err(i1480->dev, "Timed out waiting for fw to start\n"); |
448 | 434 | result = -ETIMEDOUT; |
449 | 435 | out: |
450 | - d_fnend(3, i1480->dev, "(i1480 %p) = %d\n", i1480, result); | |
451 | 436 | return result; |
452 | 437 | |
453 | 438 | } |
... | ... | @@ -467,7 +452,6 @@ |
467 | 452 | int result = 0, deprecated_name = 0; |
468 | 453 | struct i1480_rceb *rcebe = (void *) i1480->evt_buf; |
469 | 454 | |
470 | - d_fnstart(3, i1480->dev, "(%p)\n", i1480); | |
471 | 455 | result = __mac_fw_upload(i1480, i1480->mac_fw_name, "MAC"); |
472 | 456 | if (result == -ENOENT) { |
473 | 457 | result = __mac_fw_upload(i1480, i1480->mac_fw_name_deprecate, |
... | ... | @@ -501,7 +485,6 @@ |
501 | 485 | dev_err(i1480->dev, "MAC fw '%s': initialization event returns " |
502 | 486 | "wrong size (%zu bytes vs %zu needed)\n", |
503 | 487 | i1480->mac_fw_name, i1480->evt_result, sizeof(*rcebe)); |
504 | - dump_bytes(i1480->dev, rcebe, min(i1480->evt_result, (ssize_t)32)); | |
505 | 488 | goto error_size; |
506 | 489 | } |
507 | 490 | result = -EIO; |
... | ... | @@ -522,7 +505,6 @@ |
522 | 505 | error_init_timeout: |
523 | 506 | error_size: |
524 | 507 | error_setup: |
525 | - d_fnend(3, i1480->dev, "(i1480 %p) = %d\n", i1480, result); | |
526 | 508 | return result; |
527 | 509 | } |
drivers/uwb/i1480/dfu/usb.c
... | ... | @@ -43,10 +43,6 @@ |
43 | 43 | #include <linux/usb/wusb-wa.h> |
44 | 44 | #include "i1480-dfu.h" |
45 | 45 | |
46 | -#define D_LOCAL 0 | |
47 | -#include <linux/uwb/debug.h> | |
48 | - | |
49 | - | |
50 | 46 | struct i1480_usb { |
51 | 47 | struct i1480 i1480; |
52 | 48 | struct usb_device *usb_dev; |
... | ... | @@ -117,8 +113,6 @@ |
117 | 113 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); |
118 | 114 | size_t buffer_size, itr = 0; |
119 | 115 | |
120 | - d_fnstart(3, i1480->dev, "(%p, 0x%08x, %p, %zu)\n", | |
121 | - i1480, memory_address, buffer, size); | |
122 | 116 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ |
123 | 117 | while (size > 0) { |
124 | 118 | buffer_size = size < i1480->buf_size ? size : i1480->buf_size; |
125 | 119 | |
... | ... | @@ -131,16 +125,10 @@ |
131 | 125 | i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */); |
132 | 126 | if (result < 0) |
133 | 127 | break; |
134 | - d_printf(3, i1480->dev, | |
135 | - "wrote @ 0x%08x %u bytes (of %zu bytes requested)\n", | |
136 | - memory_address, result, buffer_size); | |
137 | - d_dump(4, i1480->dev, i1480->cmd_buf, result); | |
138 | 128 | itr += result; |
139 | 129 | memory_address += result; |
140 | 130 | size -= result; |
141 | 131 | } |
142 | - d_fnend(3, i1480->dev, "(%p, 0x%08x, %p, %zu) = %d\n", | |
143 | - i1480, memory_address, buffer, size, result); | |
144 | 132 | return result; |
145 | 133 | } |
146 | 134 | |
... | ... | @@ -165,8 +153,6 @@ |
165 | 153 | size_t itr, read_size = i1480->buf_size; |
166 | 154 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); |
167 | 155 | |
168 | - d_fnstart(3, i1480->dev, "(%p, 0x%08x, %zu)\n", | |
169 | - i1480, addr, size); | |
170 | 156 | BUG_ON(size > i1480->buf_size); |
171 | 157 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ |
172 | 158 | BUG_ON(read_size > 512); |
... | ... | @@ -200,10 +186,6 @@ |
200 | 186 | } |
201 | 187 | result = bytes; |
202 | 188 | out: |
203 | - d_fnend(3, i1480->dev, "(%p, 0x%08x, %zu) = %zd\n", | |
204 | - i1480, addr, size, result); | |
205 | - if (result > 0) | |
206 | - d_dump(4, i1480->dev, i1480->cmd_buf, result); | |
207 | 189 | return result; |
208 | 190 | } |
209 | 191 | |
... | ... | @@ -259,7 +241,6 @@ |
259 | 241 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); |
260 | 242 | struct usb_endpoint_descriptor *epd; |
261 | 243 | |
262 | - d_fnstart(3, dev, "(%p)\n", i1480); | |
263 | 244 | init_completion(&i1480->evt_complete); |
264 | 245 | i1480->evt_result = -EINPROGRESS; |
265 | 246 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; |
266 | 247 | |
... | ... | @@ -281,14 +262,12 @@ |
281 | 262 | goto error_wait; |
282 | 263 | } |
283 | 264 | usb_kill_urb(i1480_usb->neep_urb); |
284 | - d_fnend(3, dev, "(%p) = 0\n", i1480); | |
285 | 265 | return 0; |
286 | 266 | |
287 | 267 | error_wait: |
288 | 268 | usb_kill_urb(i1480_usb->neep_urb); |
289 | 269 | error_submit: |
290 | 270 | i1480->evt_result = result; |
291 | - d_fnend(3, dev, "(%p) = %d\n", i1480, result); | |
292 | 271 | return result; |
293 | 272 | } |
294 | 273 | |
... | ... | @@ -319,7 +298,6 @@ |
319 | 298 | struct uwb_rccb *cmd = i1480->cmd_buf; |
320 | 299 | u8 iface_no; |
321 | 300 | |
322 | - d_fnstart(3, dev, "(%p, %s, %zu)\n", i1480, cmd_name, cmd_size); | |
323 | 301 | /* Post a read on the notification & event endpoint */ |
324 | 302 | iface_no = i1480_usb->usb_iface->cur_altsetting->desc.bInterfaceNumber; |
325 | 303 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; |
326 | 304 | |
... | ... | @@ -347,15 +325,11 @@ |
347 | 325 | cmd_name, result); |
348 | 326 | goto error_submit_ep0; |
349 | 327 | } |
350 | - d_fnend(3, dev, "(%p, %s, %zu) = %d\n", | |
351 | - i1480, cmd_name, cmd_size, result); | |
352 | 328 | return result; |
353 | 329 | |
354 | 330 | error_submit_ep0: |
355 | 331 | usb_kill_urb(i1480_usb->neep_urb); |
356 | 332 | error_submit_ep1: |
357 | - d_fnend(3, dev, "(%p, %s, %zu) = %d\n", | |
358 | - i1480, cmd_name, cmd_size, result); | |
359 | 333 | return result; |
360 | 334 | } |
361 | 335 |
drivers/uwb/i1480/i1480u-wlp/rx.c
... | ... | @@ -68,11 +68,7 @@ |
68 | 68 | #include <linux/etherdevice.h> |
69 | 69 | #include "i1480u-wlp.h" |
70 | 70 | |
71 | -#define D_LOCAL 0 | |
72 | -#include <linux/uwb/debug.h> | |
73 | - | |
74 | - | |
75 | -/** | |
71 | +/* | |
76 | 72 | * Setup the RX context |
77 | 73 | * |
78 | 74 | * Each URB is provided with a transfer_buffer that is the data field |
... | ... | @@ -129,7 +125,7 @@ |
129 | 125 | } |
130 | 126 | |
131 | 127 | |
132 | -/** Release resources associated to the rx context */ | |
128 | +/* Release resources associated to the rx context */ | |
133 | 129 | void i1480u_rx_release(struct i1480u *i1480u) |
134 | 130 | { |
135 | 131 | int cnt; |
... | ... | @@ -155,7 +151,7 @@ |
155 | 151 | } |
156 | 152 | } |
157 | 153 | |
158 | -/** Fix an out-of-sequence packet */ | |
154 | +/* Fix an out-of-sequence packet */ | |
159 | 155 | #define i1480u_fix(i1480u, msg...) \ |
160 | 156 | do { \ |
161 | 157 | if (printk_ratelimit()) \ |
... | ... | @@ -166,7 +162,7 @@ |
166 | 162 | } while (0) |
167 | 163 | |
168 | 164 | |
169 | -/** Drop an out-of-sequence packet */ | |
165 | +/* Drop an out-of-sequence packet */ | |
170 | 166 | #define i1480u_drop(i1480u, msg...) \ |
171 | 167 | do { \ |
172 | 168 | if (printk_ratelimit()) \ |
... | ... | @@ -177,7 +173,7 @@ |
177 | 173 | |
178 | 174 | |
179 | 175 | |
180 | -/** Finalizes setting up the SKB and delivers it | |
176 | +/* Finalizes setting up the SKB and delivers it | |
181 | 177 | * |
182 | 178 | * We first pass the incoming frame to WLP substack for verification. It |
183 | 179 | * may also be a WLP association frame in which case WLP will take over the |
184 | 180 | |
... | ... | @@ -192,18 +188,11 @@ |
192 | 188 | struct net_device *net_dev = i1480u->net_dev; |
193 | 189 | struct device *dev = &i1480u->usb_iface->dev; |
194 | 190 | |
195 | - d_printf(6, dev, "RX delivered pre skb(%p), %u bytes\n", | |
196 | - i1480u->rx_skb, i1480u->rx_skb->len); | |
197 | - d_dump(7, dev, i1480u->rx_skb->data, i1480u->rx_skb->len); | |
198 | 191 | should_parse = wlp_receive_frame(dev, &i1480u->wlp, i1480u->rx_skb, |
199 | 192 | &i1480u->rx_srcaddr); |
200 | 193 | if (!should_parse) |
201 | 194 | goto out; |
202 | 195 | i1480u->rx_skb->protocol = eth_type_trans(i1480u->rx_skb, net_dev); |
203 | - d_printf(5, dev, "RX delivered skb(%p), %u bytes\n", | |
204 | - i1480u->rx_skb, i1480u->rx_skb->len); | |
205 | - d_dump(7, dev, i1480u->rx_skb->data, | |
206 | - i1480u->rx_skb->len > 72 ? 72 : i1480u->rx_skb->len); | |
207 | 196 | i1480u->stats.rx_packets++; |
208 | 197 | i1480u->stats.rx_bytes += i1480u->rx_untd_pkt_size; |
209 | 198 | net_dev->last_rx = jiffies; |
... | ... | @@ -216,7 +205,7 @@ |
216 | 205 | } |
217 | 206 | |
218 | 207 | |
219 | -/** | |
208 | +/* | |
220 | 209 | * Process a buffer of data received from the USB RX endpoint |
221 | 210 | * |
222 | 211 | * First fragment arrives with next or last fragment. All other fragments |
... | ... | @@ -404,7 +393,7 @@ |
404 | 393 | } |
405 | 394 | |
406 | 395 | |
407 | -/** | |
396 | +/* | |
408 | 397 | * Called when an RX URB has finished receiving or has found some kind |
409 | 398 | * of error condition. |
410 | 399 | * |
drivers/uwb/i1480/i1480u-wlp/tx.c
... | ... | @@ -55,8 +55,6 @@ |
55 | 55 | */ |
56 | 56 | |
57 | 57 | #include "i1480u-wlp.h" |
58 | -#define D_LOCAL 5 | |
59 | -#include <linux/uwb/debug.h> | |
60 | 58 | |
61 | 59 | enum { |
62 | 60 | /* This is only for Next and Last TX packets */ |
... | ... | @@ -64,7 +62,7 @@ |
64 | 62 | - sizeof(struct untd_hdr_rst), |
65 | 63 | }; |
66 | 64 | |
67 | -/** Free resources allocated to a i1480u tx context. */ | |
65 | +/* Free resources allocated to a i1480u tx context. */ | |
68 | 66 | static |
69 | 67 | void i1480u_tx_free(struct i1480u_tx *wtx) |
70 | 68 | { |
... | ... | @@ -99,7 +97,7 @@ |
99 | 97 | } |
100 | 98 | |
101 | 99 | |
102 | -/** | |
100 | +/* | |
103 | 101 | * Callback for a completed tx USB URB. |
104 | 102 | * |
105 | 103 | * TODO: |
... | ... | @@ -149,8 +147,6 @@ |
149 | 147 | <= i1480u->tx_inflight.threshold |
150 | 148 | && netif_queue_stopped(net_dev) |
151 | 149 | && i1480u->tx_inflight.threshold != 0) { |
152 | - if (d_test(2) && printk_ratelimit()) | |
153 | - d_printf(2, dev, "Restart queue. \n"); | |
154 | 150 | netif_start_queue(net_dev); |
155 | 151 | atomic_inc(&i1480u->tx_inflight.restart_count); |
156 | 152 | } |
... | ... | @@ -158,7 +154,7 @@ |
158 | 154 | } |
159 | 155 | |
160 | 156 | |
161 | -/** | |
157 | +/* | |
162 | 158 | * Given a buffer that doesn't fit in a single fragment, create an |
163 | 159 | * scatter/gather structure for delivery to the USB pipe. |
164 | 160 | * |
165 | 161 | |
... | ... | @@ -253,15 +249,11 @@ |
253 | 249 | /* Now do each remaining fragment */ |
254 | 250 | result = -EINVAL; |
255 | 251 | while (pl_size_left > 0) { |
256 | - d_printf(5, NULL, "ITR HDR: pl_size_left %zu buf_itr %zu\n", | |
257 | - pl_size_left, buf_itr - wtx->buf); | |
258 | 252 | if (buf_itr + sizeof(*untd_hdr_rst) - wtx->buf |
259 | 253 | > wtx->buf_size) { |
260 | 254 | printk(KERN_ERR "BUG: no space for header\n"); |
261 | 255 | goto error_bug; |
262 | 256 | } |
263 | - d_printf(5, NULL, "ITR HDR 2: pl_size_left %zu buf_itr %zu\n", | |
264 | - pl_size_left, buf_itr - wtx->buf); | |
265 | 257 | untd_hdr_rst = buf_itr; |
266 | 258 | buf_itr += sizeof(*untd_hdr_rst); |
267 | 259 | if (pl_size_left > i1480u_MAX_PL_SIZE) { |
... | ... | @@ -271,9 +263,6 @@ |
271 | 263 | frg_pl_size = pl_size_left; |
272 | 264 | untd_hdr_set_type(&untd_hdr_rst->hdr, i1480u_PKT_FRAG_LST); |
273 | 265 | } |
274 | - d_printf(5, NULL, | |
275 | - "ITR PL: pl_size_left %zu buf_itr %zu frg_pl_size %zu\n", | |
276 | - pl_size_left, buf_itr - wtx->buf, frg_pl_size); | |
277 | 266 | untd_hdr_set_rx_tx(&untd_hdr_rst->hdr, 0); |
278 | 267 | untd_hdr_rst->hdr.len = cpu_to_le16(frg_pl_size); |
279 | 268 | untd_hdr_rst->padding = 0; |
... | ... | @@ -286,9 +275,6 @@ |
286 | 275 | buf_itr += frg_pl_size; |
287 | 276 | pl_itr += frg_pl_size; |
288 | 277 | pl_size_left -= frg_pl_size; |
289 | - d_printf(5, NULL, | |
290 | - "ITR PL 2: pl_size_left %zu buf_itr %zu frg_pl_size %zu\n", | |
291 | - pl_size_left, buf_itr - wtx->buf, frg_pl_size); | |
292 | 278 | } |
293 | 279 | dev_kfree_skb_irq(skb); |
294 | 280 | return 0; |
... | ... | @@ -308,7 +294,7 @@ |
308 | 294 | } |
309 | 295 | |
310 | 296 | |
311 | -/** | |
297 | +/* | |
312 | 298 | * Given a buffer that fits in a single fragment, fill out a @wtx |
313 | 299 | * struct for transmitting it down the USB pipe. |
314 | 300 | * |
... | ... | @@ -346,7 +332,7 @@ |
346 | 332 | } |
347 | 333 | |
348 | 334 | |
349 | -/** | |
335 | +/* | |
350 | 336 | * Given a skb to transmit, massage it to become palatable for the TX pipe |
351 | 337 | * |
352 | 338 | * This will break the buffer in chunks smaller than |
... | ... | @@ -425,7 +411,7 @@ |
425 | 411 | return NULL; |
426 | 412 | } |
427 | 413 | |
428 | -/** | |
414 | +/* | |
429 | 415 | * Actual fragmentation and transmission of frame |
430 | 416 | * |
431 | 417 | * @wlp: WLP substack data structure |
432 | 418 | |
433 | 419 | |
... | ... | @@ -447,20 +433,12 @@ |
447 | 433 | struct i1480u_tx *wtx; |
448 | 434 | struct wlp_tx_hdr *wlp_tx_hdr; |
449 | 435 | static unsigned char dev_bcast[2] = { 0xff, 0xff }; |
450 | -#if 0 | |
451 | - int lockup = 50; | |
452 | -#endif | |
453 | 436 | |
454 | - d_fnstart(6, dev, "(skb %p (%u), net_dev %p)\n", skb, skb->len, | |
455 | - net_dev); | |
456 | 437 | BUG_ON(i1480u->wlp.rc == NULL); |
457 | 438 | if ((net_dev->flags & IFF_UP) == 0) |
458 | 439 | goto out; |
459 | 440 | result = -EBUSY; |
460 | 441 | if (atomic_read(&i1480u->tx_inflight.count) >= i1480u->tx_inflight.max) { |
461 | - if (d_test(2) && printk_ratelimit()) | |
462 | - d_printf(2, dev, "Max frames in flight " | |
463 | - "stopping queue.\n"); | |
464 | 442 | netif_stop_queue(net_dev); |
465 | 443 | goto error_max_inflight; |
466 | 444 | } |
... | ... | @@ -489,21 +467,6 @@ |
489 | 467 | wlp_tx_hdr_set_delivery_id_type(wlp_tx_hdr, i1480u->options.pca_base_priority); |
490 | 468 | } |
491 | 469 | |
492 | -#if 0 | |
493 | - dev_info(dev, "TX delivering skb -> USB, %zu bytes\n", skb->len); | |
494 | - dump_bytes(dev, skb->data, skb->len > 72 ? 72 : skb->len); | |
495 | -#endif | |
496 | -#if 0 | |
497 | - /* simulates a device lockup after every lockup# packets */ | |
498 | - if (lockup && ((i1480u->stats.tx_packets + 1) % lockup) == 0) { | |
499 | - /* Simulate a dropped transmit interrupt */ | |
500 | - net_dev->trans_start = jiffies; | |
501 | - netif_stop_queue(net_dev); | |
502 | - dev_err(dev, "Simulate lockup at %ld\n", jiffies); | |
503 | - return result; | |
504 | - } | |
505 | -#endif | |
506 | - | |
507 | 470 | result = usb_submit_urb(wtx->urb, GFP_ATOMIC); /* Go baby */ |
508 | 471 | if (result < 0) { |
509 | 472 | dev_err(dev, "TX: cannot submit URB: %d\n", result); |
... | ... | @@ -513,8 +476,6 @@ |
513 | 476 | } |
514 | 477 | atomic_inc(&i1480u->tx_inflight.count); |
515 | 478 | net_dev->trans_start = jiffies; |
516 | - d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | |
517 | - net_dev, result); | |
518 | 479 | return result; |
519 | 480 | |
520 | 481 | error_tx_urb_submit: |
521 | 482 | |
... | ... | @@ -522,13 +483,11 @@ |
522 | 483 | error_wtx_alloc: |
523 | 484 | error_max_inflight: |
524 | 485 | out: |
525 | - d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | |
526 | - net_dev, result); | |
527 | 486 | return result; |
528 | 487 | } |
529 | 488 | |
530 | 489 | |
531 | -/** | |
490 | +/* | |
532 | 491 | * Transmit an skb Called when an skbuf has to be transmitted |
533 | 492 | * |
534 | 493 | * The skb is first passed to WLP substack to ensure this is a valid |
... | ... | @@ -551,9 +510,6 @@ |
551 | 510 | struct device *dev = &i1480u->usb_iface->dev; |
552 | 511 | struct uwb_dev_addr dst; |
553 | 512 | |
554 | - d_fnstart(6, dev, "(skb %p (%u), net_dev %p)\n", skb, skb->len, | |
555 | - net_dev); | |
556 | - BUG_ON(i1480u->wlp.rc == NULL); | |
557 | 513 | if ((net_dev->flags & IFF_UP) == 0) |
558 | 514 | goto error; |
559 | 515 | result = wlp_prepare_tx_frame(dev, &i1480u->wlp, skb, &dst); |
560 | 516 | |
561 | 517 | |
562 | 518 | |
563 | 519 | |
... | ... | @@ -562,31 +518,25 @@ |
562 | 518 | "Dropping packet.\n", result); |
563 | 519 | goto error; |
564 | 520 | } else if (result == 1) { |
565 | - d_printf(6, dev, "WLP will transmit frame. \n"); | |
566 | 521 | /* trans_start time will be set when WLP actually transmits |
567 | 522 | * the frame */ |
568 | 523 | goto out; |
569 | 524 | } |
570 | - d_printf(6, dev, "Transmitting frame. \n"); | |
571 | 525 | result = i1480u_xmit_frame(&i1480u->wlp, skb, &dst); |
572 | 526 | if (result < 0) { |
573 | 527 | dev_err(dev, "Frame TX failed (%d).\n", result); |
574 | 528 | goto error; |
575 | 529 | } |
576 | - d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | |
577 | - net_dev, result); | |
578 | 530 | return NETDEV_TX_OK; |
579 | 531 | error: |
580 | 532 | dev_kfree_skb_any(skb); |
581 | 533 | i1480u->stats.tx_dropped++; |
582 | 534 | out: |
583 | - d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | |
584 | - net_dev, result); | |
585 | 535 | return NETDEV_TX_OK; |
586 | 536 | } |
587 | 537 | |
588 | 538 | |
589 | -/** | |
539 | +/* | |
590 | 540 | * Called when a pkt transmission doesn't complete in a reasonable period |
591 | 541 | * Device reset may sleep - do it outside of interrupt context (delayed) |
592 | 542 | */ |
drivers/uwb/lc-dev.c
... | ... | @@ -22,7 +22,6 @@ |
22 | 22 | * |
23 | 23 | * FIXME: docs |
24 | 24 | */ |
25 | - | |
26 | 25 | #include <linux/kernel.h> |
27 | 26 | #include <linux/device.h> |
28 | 27 | #include <linux/err.h> |
... | ... | @@ -30,10 +29,6 @@ |
30 | 29 | #include <linux/random.h> |
31 | 30 | #include "uwb-internal.h" |
32 | 31 | |
33 | -#define D_LOCAL 1 | |
34 | -#include <linux/uwb/debug.h> | |
35 | - | |
36 | - | |
37 | 32 | /* We initialize addresses to 0xff (invalid, as it is bcast) */ |
38 | 33 | static inline void uwb_dev_addr_init(struct uwb_dev_addr *addr) |
39 | 34 | { |
40 | 35 | |
41 | 36 | |
... | ... | @@ -104,12 +99,9 @@ |
104 | 99 | { |
105 | 100 | struct uwb_dev *uwb_dev = to_uwb_dev(dev); |
106 | 101 | |
107 | - d_fnstart(4, NULL, "(dev %p uwb_dev %p)\n", dev, uwb_dev); | |
108 | 102 | uwb_bce_put(uwb_dev->bce); |
109 | - d_printf(0, &uwb_dev->dev, "uwb_dev %p freed\n", uwb_dev); | |
110 | 103 | memset(uwb_dev, 0x69, sizeof(*uwb_dev)); |
111 | 104 | kfree(uwb_dev); |
112 | - d_fnend(4, NULL, "(dev %p uwb_dev %p) = void\n", dev, uwb_dev); | |
113 | 105 | } |
114 | 106 | |
115 | 107 | /* |
116 | 108 | |
... | ... | @@ -275,12 +267,8 @@ |
275 | 267 | */ |
276 | 268 | static int __uwb_dev_sys_add(struct uwb_dev *uwb_dev, struct device *parent_dev) |
277 | 269 | { |
278 | - int result; | |
279 | 270 | struct device *dev; |
280 | 271 | |
281 | - d_fnstart(4, NULL, "(uwb_dev %p parent_dev %p)\n", uwb_dev, parent_dev); | |
282 | - BUG_ON(parent_dev == NULL); | |
283 | - | |
284 | 272 | dev = &uwb_dev->dev; |
285 | 273 | /* Device sysfs files are only useful for neighbor devices not |
286 | 274 | local radio controllers. */ |
287 | 275 | |
288 | 276 | |
... | ... | @@ -289,18 +277,14 @@ |
289 | 277 | dev->parent = parent_dev; |
290 | 278 | dev_set_drvdata(dev, uwb_dev); |
291 | 279 | |
292 | - result = device_add(dev); | |
293 | - d_fnend(4, NULL, "(uwb_dev %p parent_dev %p) = %d\n", uwb_dev, parent_dev, result); | |
294 | - return result; | |
280 | + return device_add(dev); | |
295 | 281 | } |
296 | 282 | |
297 | 283 | |
298 | 284 | static void __uwb_dev_sys_rm(struct uwb_dev *uwb_dev) |
299 | 285 | { |
300 | - d_fnstart(4, NULL, "(uwb_dev %p)\n", uwb_dev); | |
301 | 286 | dev_set_drvdata(&uwb_dev->dev, NULL); |
302 | 287 | device_del(&uwb_dev->dev); |
303 | - d_fnend(4, NULL, "(uwb_dev %p) = void\n", uwb_dev); | |
304 | 288 | } |
305 | 289 | |
306 | 290 | |
... | ... | @@ -384,7 +368,6 @@ |
384 | 368 | struct device *dev = &uwb_dev->dev; |
385 | 369 | char macbuf[UWB_ADDR_STRSIZE], devbuf[UWB_ADDR_STRSIZE]; |
386 | 370 | |
387 | - d_fnstart(3, NULL, "(dev %p [uwb_dev %p], uwb_rc %p)\n", dev, uwb_dev, rc); | |
388 | 371 | uwb_mac_addr_print(macbuf, sizeof(macbuf), &uwb_dev->mac_addr); |
389 | 372 | uwb_dev_addr_print(devbuf, sizeof(devbuf), &uwb_dev->dev_addr); |
390 | 373 | dev_info(dev, "uwb device (mac %s dev %s) disconnected from %s %s\n", |
... | ... | @@ -393,7 +376,7 @@ |
393 | 376 | rc ? dev_name(rc->uwb_dev.dev.parent) : ""); |
394 | 377 | uwb_dev_rm(uwb_dev); |
395 | 378 | uwb_dev_put(uwb_dev); /* for the creation in _onair() */ |
396 | - d_fnend(3, NULL, "(dev %p [uwb_dev %p], uwb_rc %p) = 0\n", dev, uwb_dev, rc); | |
379 | + | |
397 | 380 | return 0; |
398 | 381 | } |
399 | 382 |
drivers/uwb/neh.c
... | ... | @@ -86,8 +86,6 @@ |
86 | 86 | #include <linux/err.h> |
87 | 87 | |
88 | 88 | #include "uwb-internal.h" |
89 | -#define D_LOCAL 0 | |
90 | -#include <linux/uwb/debug.h> | |
91 | 89 | |
92 | 90 | /* |
93 | 91 | * UWB Radio Controller Notification/Event Handle |
... | ... | @@ -479,8 +477,6 @@ |
479 | 477 | size_t size, real_size, event_size; |
480 | 478 | int needtofree; |
481 | 479 | |
482 | - d_fnstart(3, dev, "(rc %p buf %p %zu buf_size)\n", rc, buf, buf_size); | |
483 | - d_printf(2, dev, "groking event block: %zu bytes\n", buf_size); | |
484 | 480 | itr = buf; |
485 | 481 | size = buf_size; |
486 | 482 | while (size > 0) { |
487 | 483 | |
... | ... | @@ -528,10 +524,7 @@ |
528 | 524 | |
529 | 525 | itr += real_size; |
530 | 526 | size -= real_size; |
531 | - d_printf(2, dev, "consumed %zd bytes, %zu left\n", | |
532 | - event_size, size); | |
533 | 527 | } |
534 | - d_fnend(3, dev, "(rc %p buf %p %zu buf_size) = void\n", rc, buf, buf_size); | |
535 | 528 | } |
536 | 529 | EXPORT_SYMBOL_GPL(uwb_rc_neh_grok); |
537 | 530 |
drivers/uwb/reset.c
drivers/uwb/umc-dev.c
... | ... | @@ -7,8 +7,6 @@ |
7 | 7 | */ |
8 | 8 | #include <linux/kernel.h> |
9 | 9 | #include <linux/uwb/umc.h> |
10 | -#define D_LOCAL 0 | |
11 | -#include <linux/uwb/debug.h> | |
12 | 10 | |
13 | 11 | static void umc_device_release(struct device *dev) |
14 | 12 | { |
... | ... | @@ -53,8 +51,6 @@ |
53 | 51 | { |
54 | 52 | int err; |
55 | 53 | |
56 | - d_fnstart(3, &umc->dev, "(umc_dev %p)\n", umc); | |
57 | - | |
58 | 54 | err = request_resource(umc->resource.parent, &umc->resource); |
59 | 55 | if (err < 0) { |
60 | 56 | dev_err(&umc->dev, "can't allocate resource range " |
61 | 57 | |
... | ... | @@ -68,13 +64,11 @@ |
68 | 64 | err = device_register(&umc->dev); |
69 | 65 | if (err < 0) |
70 | 66 | goto error_device_register; |
71 | - d_fnend(3, &umc->dev, "(umc_dev %p) = 0\n", umc); | |
72 | 67 | return 0; |
73 | 68 | |
74 | 69 | error_device_register: |
75 | 70 | release_resource(&umc->resource); |
76 | 71 | error_request_resource: |
77 | - d_fnend(3, &umc->dev, "(umc_dev %p) = %d\n", umc, err); | |
78 | 72 | return err; |
79 | 73 | } |
80 | 74 | EXPORT_SYMBOL_GPL(umc_device_register); |
81 | 75 | |
... | ... | @@ -94,10 +88,8 @@ |
94 | 88 | if (!umc) |
95 | 89 | return; |
96 | 90 | dev = get_device(&umc->dev); |
97 | - d_fnstart(3, dev, "(umc_dev %p)\n", umc); | |
98 | 91 | device_unregister(&umc->dev); |
99 | 92 | release_resource(&umc->resource); |
100 | - d_fnend(3, dev, "(umc_dev %p) = void\n", umc); | |
101 | 93 | put_device(dev); |
102 | 94 | } |
103 | 95 | EXPORT_SYMBOL_GPL(umc_device_unregister); |
drivers/uwb/uwbd.c
... | ... | @@ -68,17 +68,13 @@ |
68 | 68 | * |
69 | 69 | * Handler functions are called normally uwbd_evt_handle_*(). |
70 | 70 | */ |
71 | - | |
72 | 71 | #include <linux/kthread.h> |
73 | 72 | #include <linux/module.h> |
74 | 73 | #include <linux/freezer.h> |
74 | + | |
75 | 75 | #include "uwb-internal.h" |
76 | 76 | |
77 | -#define D_LOCAL 1 | |
78 | -#include <linux/uwb/debug.h> | |
79 | - | |
80 | - | |
81 | -/** | |
77 | +/* | |
82 | 78 | * UWBD Event handler function signature |
83 | 79 | * |
84 | 80 | * Return !0 if the event needs not to be freed (ie the handler |
... | ... | @@ -101,9 +97,8 @@ |
101 | 97 | const char *name; |
102 | 98 | }; |
103 | 99 | |
104 | -/** Table of handlers for and properties of the UWBD Radio Control Events */ | |
105 | -static | |
106 | -struct uwbd_event uwbd_events[] = { | |
100 | +/* Table of handlers for and properties of the UWBD Radio Control Events */ | |
101 | +static struct uwbd_event uwbd_urc_events[] = { | |
107 | 102 | [UWB_RC_EVT_IE_RCV] = { |
108 | 103 | .handler = uwbd_evt_handle_rc_ie_rcv, |
109 | 104 | .name = "IE_RECEIVED" |
110 | 105 | |
... | ... | @@ -146,23 +141,15 @@ |
146 | 141 | size_t size; |
147 | 142 | }; |
148 | 143 | |
149 | -#define UWBD_EVT_TYPE_HANDLER(n,a) { \ | |
150 | - .name = (n), \ | |
151 | - .uwbd_events = (a), \ | |
152 | - .size = sizeof(a)/sizeof((a)[0]) \ | |
153 | -} | |
154 | - | |
155 | - | |
156 | -/** Table of handlers for each UWBD Event type. */ | |
157 | -static | |
158 | -struct uwbd_evt_type_handler uwbd_evt_type_handlers[] = { | |
159 | - [UWB_RC_CET_GENERAL] = UWBD_EVT_TYPE_HANDLER("RC", uwbd_events) | |
144 | +/* Table of handlers for each UWBD Event type. */ | |
145 | +static struct uwbd_evt_type_handler uwbd_urc_evt_type_handlers[] = { | |
146 | + [UWB_RC_CET_GENERAL] = { | |
147 | + .name = "URC", | |
148 | + .uwbd_events = uwbd_urc_events, | |
149 | + .size = ARRAY_SIZE(uwbd_urc_events), | |
150 | + }, | |
160 | 151 | }; |
161 | 152 | |
162 | -static const | |
163 | -size_t uwbd_evt_type_handlers_len = | |
164 | - sizeof(uwbd_evt_type_handlers) / sizeof(uwbd_evt_type_handlers[0]); | |
165 | - | |
166 | 153 | static const struct uwbd_event uwbd_message_handlers[] = { |
167 | 154 | [UWB_EVT_MSG_RESET] = { |
168 | 155 | .handler = uwbd_msg_handle_reset, |
... | ... | @@ -170,7 +157,7 @@ |
170 | 157 | }, |
171 | 158 | }; |
172 | 159 | |
173 | -/** | |
160 | +/* | |
174 | 161 | * Handle an URC event passed to the UWB Daemon |
175 | 162 | * |
176 | 163 | * @evt: the event to handle |
... | ... | @@ -190,6 +177,7 @@ |
190 | 177 | static |
191 | 178 | int uwbd_event_handle_urc(struct uwb_event *evt) |
192 | 179 | { |
180 | + int result = -EINVAL; | |
193 | 181 | struct uwbd_evt_type_handler *type_table; |
194 | 182 | uwbd_evt_handler_f handler; |
195 | 183 | u8 type, context; |
196 | 184 | |
... | ... | @@ -199,26 +187,24 @@ |
199 | 187 | event = le16_to_cpu(evt->notif.rceb->wEvent); |
200 | 188 | context = evt->notif.rceb->bEventContext; |
201 | 189 | |
202 | - if (type > uwbd_evt_type_handlers_len) { | |
203 | - printk(KERN_ERR "UWBD: event type %u: unknown (too high)\n", type); | |
204 | - return -EINVAL; | |
205 | - } | |
206 | - type_table = &uwbd_evt_type_handlers[type]; | |
207 | - if (type_table->uwbd_events == NULL) { | |
208 | - printk(KERN_ERR "UWBD: event type %u: unknown\n", type); | |
209 | - return -EINVAL; | |
210 | - } | |
211 | - if (event > type_table->size) { | |
212 | - printk(KERN_ERR "UWBD: event %s[%u]: unknown (too high)\n", | |
213 | - type_table->name, event); | |
214 | - return -EINVAL; | |
215 | - } | |
190 | + if (type > ARRAY_SIZE(uwbd_urc_evt_type_handlers)) | |
191 | + goto out; | |
192 | + type_table = &uwbd_urc_evt_type_handlers[type]; | |
193 | + if (type_table->uwbd_events == NULL) | |
194 | + goto out; | |
195 | + if (event > type_table->size) | |
196 | + goto out; | |
216 | 197 | handler = type_table->uwbd_events[event].handler; |
217 | - if (handler == NULL) { | |
218 | - printk(KERN_ERR "UWBD: event %s[%u]: unknown\n", type_table->name, event); | |
219 | - return -EINVAL; | |
220 | - } | |
221 | - return (*handler)(evt); | |
198 | + if (handler == NULL) | |
199 | + goto out; | |
200 | + | |
201 | + result = (*handler)(evt); | |
202 | +out: | |
203 | + if (result < 0) | |
204 | + dev_err(&evt->rc->uwb_dev.dev, | |
205 | + "UWBD: event 0x%02x/%04x/%02x, handling failed: %d\n", | |
206 | + type, event, context, result); | |
207 | + return result; | |
222 | 208 | } |
223 | 209 | |
224 | 210 | static void uwbd_event_handle_message(struct uwb_event *evt) |
drivers/uwb/whc-rc.c
... | ... | @@ -48,11 +48,9 @@ |
48 | 48 | #include <linux/uwb.h> |
49 | 49 | #include <linux/uwb/whci.h> |
50 | 50 | #include <linux/uwb/umc.h> |
51 | + | |
51 | 52 | #include "uwb-internal.h" |
52 | 53 | |
53 | -#define D_LOCAL 0 | |
54 | -#include <linux/uwb/debug.h> | |
55 | - | |
56 | 54 | /** |
57 | 55 | * Descriptor for an instance of the UWB Radio Control Driver that |
58 | 56 | * attaches to the URC interface of the WHCI PCI card. |
59 | 57 | |
... | ... | @@ -97,14 +95,9 @@ |
97 | 95 | struct device *dev = &whcrc->umc_dev->dev; |
98 | 96 | u32 urccmd; |
99 | 97 | |
100 | - d_fnstart(3, dev, "(%p, %p, %zu)\n", uwb_rc, cmd, cmd_size); | |
101 | - might_sleep(); | |
98 | + if (cmd_size >= 4096) | |
99 | + return -EINVAL; | |
102 | 100 | |
103 | - if (cmd_size >= 4096) { | |
104 | - result = -E2BIG; | |
105 | - goto error; | |
106 | - } | |
107 | - | |
108 | 101 | /* |
109 | 102 | * If the URC is halted, then the hardware has reset itself. |
110 | 103 | * Attempt to recover by restarting the device and then return |
111 | 104 | |
... | ... | @@ -114,16 +107,14 @@ |
114 | 107 | if (le_readl(whcrc->rc_base + URCSTS) & URCSTS_HALTED) { |
115 | 108 | dev_err(dev, "requesting reset of halted radio controller\n"); |
116 | 109 | uwb_rc_reset_all(uwb_rc); |
117 | - result = -EIO; | |
118 | - goto error; | |
110 | + return -EIO; | |
119 | 111 | } |
120 | 112 | |
121 | 113 | result = wait_event_timeout(whcrc->cmd_wq, |
122 | 114 | !(le_readl(whcrc->rc_base + URCCMD) & URCCMD_ACTIVE), HZ/2); |
123 | 115 | if (result == 0) { |
124 | 116 | dev_err(dev, "device is not ready to execute commands\n"); |
125 | - result = -ETIMEDOUT; | |
126 | - goto error; | |
117 | + return -ETIMEDOUT; | |
127 | 118 | } |
128 | 119 | |
129 | 120 | memmove(whcrc->cmd_buf, cmd, cmd_size); |
... | ... | @@ -136,10 +127,7 @@ |
136 | 127 | whcrc->rc_base + URCCMD); |
137 | 128 | spin_unlock(&whcrc->irq_lock); |
138 | 129 | |
139 | -error: | |
140 | - d_fnend(3, dev, "(%p, %p, %zu) = %d\n", | |
141 | - uwb_rc, cmd, cmd_size, result); | |
142 | - return result; | |
130 | + return 0; | |
143 | 131 | } |
144 | 132 | |
145 | 133 | static int whcrc_reset(struct uwb_rc *rc) |
146 | 134 | |
147 | 135 | |
148 | 136 | |
149 | 137 | |
... | ... | @@ -166,34 +154,25 @@ |
166 | 154 | static |
167 | 155 | void whcrc_enable_events(struct whcrc *whcrc) |
168 | 156 | { |
169 | - struct device *dev = &whcrc->umc_dev->dev; | |
170 | 157 | u32 urccmd; |
171 | 158 | |
172 | - d_fnstart(4, dev, "(whcrc %p)\n", whcrc); | |
173 | - | |
174 | 159 | le_writeq(whcrc->evt_dma_buf, whcrc->rc_base + URCEVTADDR); |
175 | 160 | |
176 | 161 | spin_lock(&whcrc->irq_lock); |
177 | 162 | urccmd = le_readl(whcrc->rc_base + URCCMD) & ~URCCMD_ACTIVE; |
178 | 163 | le_writel(urccmd | URCCMD_EARV, whcrc->rc_base + URCCMD); |
179 | 164 | spin_unlock(&whcrc->irq_lock); |
180 | - | |
181 | - d_fnend(4, dev, "(whcrc %p) = void\n", whcrc); | |
182 | 165 | } |
183 | 166 | |
184 | 167 | static void whcrc_event_work(struct work_struct *work) |
185 | 168 | { |
186 | 169 | struct whcrc *whcrc = container_of(work, struct whcrc, event_work); |
187 | - struct device *dev = &whcrc->umc_dev->dev; | |
188 | 170 | size_t size; |
189 | 171 | u64 urcevtaddr; |
190 | 172 | |
191 | 173 | urcevtaddr = le_readq(whcrc->rc_base + URCEVTADDR); |
192 | 174 | size = urcevtaddr & URCEVTADDR_OFFSET_MASK; |
193 | 175 | |
194 | - d_printf(3, dev, "received %zu octet event\n", size); | |
195 | - d_dump(4, dev, whcrc->evt_buf, size > 32 ? 32 : size); | |
196 | - | |
197 | 176 | uwb_rc_neh_grok(whcrc->uwb_rc, whcrc->evt_buf, size); |
198 | 177 | whcrc_enable_events(whcrc); |
199 | 178 | } |
200 | 179 | |
201 | 180 | |
202 | 181 | |
... | ... | @@ -216,22 +195,15 @@ |
216 | 195 | return IRQ_NONE; |
217 | 196 | le_writel(urcsts & URCSTS_INT_MASK, whcrc->rc_base + URCSTS); |
218 | 197 | |
219 | - d_printf(4, dev, "acked 0x%08x, urcsts 0x%08x\n", | |
220 | - le_readl(whcrc->rc_base + URCSTS), urcsts); | |
221 | - | |
222 | 198 | if (urcsts & URCSTS_HSE) { |
223 | 199 | dev_err(dev, "host system error -- hardware halted\n"); |
224 | 200 | /* FIXME: do something sensible here */ |
225 | 201 | goto out; |
226 | 202 | } |
227 | - if (urcsts & URCSTS_ER) { | |
228 | - d_printf(3, dev, "ER: event ready\n"); | |
203 | + if (urcsts & URCSTS_ER) | |
229 | 204 | schedule_work(&whcrc->event_work); |
230 | - } | |
231 | - if (urcsts & URCSTS_RCI) { | |
232 | - d_printf(3, dev, "RCI: ready to execute another command\n"); | |
205 | + if (urcsts & URCSTS_RCI) | |
233 | 206 | wake_up_all(&whcrc->cmd_wq); |
234 | - } | |
235 | 207 | out: |
236 | 208 | return IRQ_HANDLED; |
237 | 209 | } |
... | ... | @@ -250,8 +222,7 @@ |
250 | 222 | whcrc->area = umc_dev->resource.start; |
251 | 223 | whcrc->rc_len = umc_dev->resource.end - umc_dev->resource.start + 1; |
252 | 224 | result = -EBUSY; |
253 | - if (request_mem_region(whcrc->area, whcrc->rc_len, KBUILD_MODNAME) | |
254 | - == NULL) { | |
225 | + if (request_mem_region(whcrc->area, whcrc->rc_len, KBUILD_MODNAME) == NULL) { | |
255 | 226 | dev_err(dev, "can't request URC region (%zu bytes @ 0x%lx): %d\n", |
256 | 227 | whcrc->rc_len, whcrc->area, result); |
257 | 228 | goto error_request_region; |
... | ... | @@ -286,8 +257,6 @@ |
286 | 257 | dev_err(dev, "Can't allocate evt transfer buffer\n"); |
287 | 258 | goto error_evt_buffer; |
288 | 259 | } |
289 | - d_printf(3, dev, "UWB RC Interface: %zu bytes at 0x%p, irq %u\n", | |
290 | - whcrc->rc_len, whcrc->rc_base, umc_dev->irq); | |
291 | 260 | return 0; |
292 | 261 | |
293 | 262 | error_evt_buffer: |
... | ... | @@ -396,7 +365,6 @@ |
396 | 365 | struct whcrc *whcrc; |
397 | 366 | struct device *dev = &umc_dev->dev; |
398 | 367 | |
399 | - d_fnstart(3, dev, "(umc_dev %p)\n", umc_dev); | |
400 | 368 | result = -ENOMEM; |
401 | 369 | uwb_rc = uwb_rc_alloc(); |
402 | 370 | if (uwb_rc == NULL) { |
... | ... | @@ -428,7 +396,6 @@ |
428 | 396 | if (result < 0) |
429 | 397 | goto error_rc_add; |
430 | 398 | umc_set_drvdata(umc_dev, whcrc); |
431 | - d_fnend(3, dev, "(umc_dev %p) = 0\n", umc_dev); | |
432 | 399 | return 0; |
433 | 400 | |
434 | 401 | error_rc_add: |
... | ... | @@ -438,7 +405,6 @@ |
438 | 405 | error_alloc: |
439 | 406 | uwb_rc_put(uwb_rc); |
440 | 407 | error_rc_alloc: |
441 | - d_fnend(3, dev, "(umc_dev %p) = %d\n", umc_dev, result); | |
442 | 408 | return result; |
443 | 409 | } |
444 | 410 | |
... | ... | @@ -461,7 +427,6 @@ |
461 | 427 | whcrc_release_rc_umc(whcrc); |
462 | 428 | kfree(whcrc); |
463 | 429 | uwb_rc_put(uwb_rc); |
464 | - d_printf(1, &umc_dev->dev, "freed whcrc %p\n", whcrc); | |
465 | 430 | } |
466 | 431 | |
467 | 432 | static int whcrc_pre_reset(struct umc_dev *umc) |
drivers/uwb/wlp/eda.c
... | ... | @@ -51,9 +51,7 @@ |
51 | 51 | * the tag and address of the transmitting neighbor. |
52 | 52 | */ |
53 | 53 | |
54 | -#define D_LOCAL 5 | |
55 | 54 | #include <linux/netdevice.h> |
56 | -#include <linux/uwb/debug.h> | |
57 | 55 | #include <linux/etherdevice.h> |
58 | 56 | #include <linux/wlp.h> |
59 | 57 | #include "wlp-internal.h" |
... | ... | @@ -304,7 +302,6 @@ |
304 | 302 | { |
305 | 303 | int result = 0; |
306 | 304 | struct wlp *wlp = container_of(eda, struct wlp, eda); |
307 | - struct device *dev = &wlp->rc->uwb_dev.dev; | |
308 | 305 | struct wlp_eda_node *itr; |
309 | 306 | unsigned long flags; |
310 | 307 | int found = 0; |
311 | 308 | |
312 | 309 | |
313 | 310 | |
... | ... | @@ -313,40 +310,14 @@ |
313 | 310 | list_for_each_entry(itr, &eda->cache, list_node) { |
314 | 311 | if (!memcmp(itr->virt_addr, virt_addr, |
315 | 312 | sizeof(itr->virt_addr))) { |
316 | - d_printf(6, dev, "EDA: looking for " | |
317 | - "%02x:%02x:%02x:%02x:%02x:%02x hit %02x:%02x " | |
318 | - "wss %p tag 0x%02x state %u\n", | |
319 | - virt_addr[0], virt_addr[1], | |
320 | - virt_addr[2], virt_addr[3], | |
321 | - virt_addr[4], virt_addr[5], | |
322 | - itr->dev_addr.data[1], | |
323 | - itr->dev_addr.data[0], itr->wss, | |
324 | - itr->tag, itr->state); | |
325 | 313 | result = (*function)(wlp, itr, priv); |
326 | 314 | *dev_addr = itr->dev_addr; |
327 | 315 | found = 1; |
328 | 316 | break; |
329 | - } else | |
330 | - d_printf(6, dev, "EDA: looking for " | |
331 | - "%02x:%02x:%02x:%02x:%02x:%02x " | |
332 | - "against " | |
333 | - "%02x:%02x:%02x:%02x:%02x:%02x miss\n", | |
334 | - virt_addr[0], virt_addr[1], | |
335 | - virt_addr[2], virt_addr[3], | |
336 | - virt_addr[4], virt_addr[5], | |
337 | - itr->virt_addr[0], itr->virt_addr[1], | |
338 | - itr->virt_addr[2], itr->virt_addr[3], | |
339 | - itr->virt_addr[4], itr->virt_addr[5]); | |
317 | + } | |
340 | 318 | } |
341 | - if (!found) { | |
342 | - if (printk_ratelimit()) | |
343 | - dev_err(dev, "EDA: Eth addr %02x:%02x:%02x" | |
344 | - ":%02x:%02x:%02x not found.\n", | |
345 | - virt_addr[0], virt_addr[1], | |
346 | - virt_addr[2], virt_addr[3], | |
347 | - virt_addr[4], virt_addr[5]); | |
319 | + if (!found) | |
348 | 320 | result = -ENODEV; |
349 | - } | |
350 | 321 | spin_unlock_irqrestore(&eda->lock, flags); |
351 | 322 | return result; |
352 | 323 | } |
drivers/uwb/wlp/messages.c
... | ... | @@ -24,8 +24,7 @@ |
24 | 24 | */ |
25 | 25 | |
26 | 26 | #include <linux/wlp.h> |
27 | -#define D_LOCAL 6 | |
28 | -#include <linux/uwb/debug.h> | |
27 | + | |
29 | 28 | #include "wlp-internal.h" |
30 | 29 | |
31 | 30 | static |
32 | 31 | |
33 | 32 | |
34 | 33 | |
... | ... | @@ -105,24 +104,18 @@ |
105 | 104 | #define wlp_set(type, type_code, name) \ |
106 | 105 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value) \ |
107 | 106 | { \ |
108 | - d_fnstart(6, NULL, "(attribute %p)\n", attr); \ | |
109 | 107 | wlp_set_attr_hdr(&attr->hdr, type_code, \ |
110 | 108 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ |
111 | 109 | attr->name = value; \ |
112 | - d_dump(6, NULL, attr, sizeof(*attr)); \ | |
113 | - d_fnend(6, NULL, "(attribute %p)\n", attr); \ | |
114 | 110 | return sizeof(*attr); \ |
115 | 111 | } |
116 | 112 | |
117 | 113 | #define wlp_pset(type, type_code, name) \ |
118 | 114 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value) \ |
119 | 115 | { \ |
120 | - d_fnstart(6, NULL, "(attribute %p)\n", attr); \ | |
121 | 116 | wlp_set_attr_hdr(&attr->hdr, type_code, \ |
122 | 117 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ |
123 | 118 | attr->name = *value; \ |
124 | - d_dump(6, NULL, attr, sizeof(*attr)); \ | |
125 | - d_fnend(6, NULL, "(attribute %p)\n", attr); \ | |
126 | 119 | return sizeof(*attr); \ |
127 | 120 | } |
128 | 121 | |
129 | 122 | |
... | ... | @@ -139,11 +132,8 @@ |
139 | 132 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value, \ |
140 | 133 | size_t len) \ |
141 | 134 | { \ |
142 | - d_fnstart(6, NULL, "(attribute %p)\n", attr); \ | |
143 | 135 | wlp_set_attr_hdr(&attr->hdr, type_code, len); \ |
144 | 136 | memcpy(attr->name, value, len); \ |
145 | - d_dump(6, NULL, attr, sizeof(*attr) + len); \ | |
146 | - d_fnend(6, NULL, "(attribute %p)\n", attr); \ | |
147 | 137 | return sizeof(*attr) + len; \ |
148 | 138 | } |
149 | 139 | |
... | ... | @@ -182,7 +172,7 @@ |
182 | 172 | size_t datalen; |
183 | 173 | void *ptr = attr->wss_info; |
184 | 174 | size_t used = sizeof(*attr); |
185 | - d_fnstart(6, NULL, "(attribute %p)\n", attr); | |
175 | + | |
186 | 176 | datalen = sizeof(struct wlp_wss_info) + strlen(wss->name); |
187 | 177 | wlp_set_attr_hdr(&attr->hdr, WLP_ATTR_WSS_INFO, datalen); |
188 | 178 | used = wlp_set_wssid(ptr, &wss->wssid); |
... | ... | @@ -190,9 +180,6 @@ |
190 | 180 | used += wlp_set_accept_enrl(ptr + used, wss->accept_enroll); |
191 | 181 | used += wlp_set_wss_sec_status(ptr + used, wss->secure_status); |
192 | 182 | used += wlp_set_wss_bcast(ptr + used, &wss->bcast); |
193 | - d_dump(6, NULL, attr, sizeof(*attr) + datalen); | |
194 | - d_fnend(6, NULL, "(attribute %p, used %d)\n", | |
195 | - attr, (int)(sizeof(*attr) + used)); | |
196 | 183 | return sizeof(*attr) + used; |
197 | 184 | } |
198 | 185 | |
... | ... | @@ -414,7 +401,6 @@ |
414 | 401 | size_t used = 0; |
415 | 402 | ssize_t result = -EINVAL; |
416 | 403 | |
417 | - d_printf(6, dev, "WLP: WSS info: Retrieving WSS name\n"); | |
418 | 404 | result = wlp_get_wss_name(wlp, ptr, info->name, buflen); |
419 | 405 | if (result < 0) { |
420 | 406 | dev_err(dev, "WLP: unable to obtain WSS name from " |
... | ... | @@ -422,7 +408,7 @@ |
422 | 408 | goto error_parse; |
423 | 409 | } |
424 | 410 | used += result; |
425 | - d_printf(6, dev, "WLP: WSS info: Retrieving accept enroll\n"); | |
411 | + | |
426 | 412 | result = wlp_get_accept_enrl(wlp, ptr + used, &info->accept_enroll, |
427 | 413 | buflen - used); |
428 | 414 | if (result < 0) { |
... | ... | @@ -437,7 +423,7 @@ |
437 | 423 | goto error_parse; |
438 | 424 | } |
439 | 425 | used += result; |
440 | - d_printf(6, dev, "WLP: WSS info: Retrieving secure status\n"); | |
426 | + | |
441 | 427 | result = wlp_get_wss_sec_status(wlp, ptr + used, &info->sec_status, |
442 | 428 | buflen - used); |
443 | 429 | if (result < 0) { |
... | ... | @@ -452,7 +438,7 @@ |
452 | 438 | goto error_parse; |
453 | 439 | } |
454 | 440 | used += result; |
455 | - d_printf(6, dev, "WLP: WSS info: Retrieving broadcast\n"); | |
441 | + | |
456 | 442 | result = wlp_get_wss_bcast(wlp, ptr + used, &info->bcast, |
457 | 443 | buflen - used); |
458 | 444 | if (result < 0) { |
... | ... | @@ -530,7 +516,7 @@ |
530 | 516 | len = result; |
531 | 517 | used = sizeof(*attr); |
532 | 518 | ptr = attr; |
533 | - d_printf(6, dev, "WLP: WSS info: Retrieving WSSID\n"); | |
519 | + | |
534 | 520 | result = wlp_get_wssid(wlp, ptr + used, wssid, buflen - used); |
535 | 521 | if (result < 0) { |
536 | 522 | dev_err(dev, "WLP: unable to obtain WSSID from WSS info.\n"); |
... | ... | @@ -553,8 +539,6 @@ |
553 | 539 | goto out; |
554 | 540 | } |
555 | 541 | result = used; |
556 | - d_printf(6, dev, "WLP: Successfully parsed WLP information " | |
557 | - "attribute. used %zu bytes\n", used); | |
558 | 542 | out: |
559 | 543 | return result; |
560 | 544 | } |
... | ... | @@ -598,8 +582,6 @@ |
598 | 582 | struct wlp_wssid_e *wssid_e; |
599 | 583 | char buf[WLP_WSS_UUID_STRSIZE]; |
600 | 584 | |
601 | - d_fnstart(6, dev, "wlp %p, attr %p, neighbor %p, wss %p, buflen %d \n", | |
602 | - wlp, attr, neighbor, wss, (int)buflen); | |
603 | 585 | if (buflen < 0) |
604 | 586 | goto out; |
605 | 587 | |
... | ... | @@ -638,8 +620,7 @@ |
638 | 620 | wss->accept_enroll = wss_info.accept_enroll; |
639 | 621 | wss->state = WLP_WSS_STATE_PART_ENROLLED; |
640 | 622 | wlp_wss_uuid_print(buf, sizeof(buf), &wssid); |
641 | - d_printf(2, dev, "WLP: Found WSS %s. Enrolling.\n", | |
642 | - buf); | |
623 | + dev_dbg(dev, "WLP: Found WSS %s. Enrolling.\n", buf); | |
643 | 624 | } else { |
644 | 625 | wssid_e = wlp_create_wssid_e(wlp, neighbor); |
645 | 626 | if (wssid_e == NULL) { |
... | ... | @@ -660,9 +641,6 @@ |
660 | 641 | if (result < 0 && !enroll) /* this was a discovery */ |
661 | 642 | wlp_remove_neighbor_tmp_info(neighbor); |
662 | 643 | out: |
663 | - d_fnend(6, dev, "wlp %p, attr %p, neighbor %p, wss %p, buflen %d, " | |
664 | - "result %d \n", wlp, attr, neighbor, wss, (int)buflen, | |
665 | - (int)result); | |
666 | 644 | return result; |
667 | 645 | |
668 | 646 | } |
... | ... | @@ -718,7 +696,6 @@ |
718 | 696 | struct sk_buff *_skb; |
719 | 697 | void *d1_itr; |
720 | 698 | |
721 | - d_fnstart(6, dev, "wlp %p\n", wlp); | |
722 | 699 | if (wlp->dev_info == NULL) { |
723 | 700 | result = __wlp_setup_device_info(wlp); |
724 | 701 | if (result < 0) { |
... | ... | @@ -728,24 +705,6 @@ |
728 | 705 | } |
729 | 706 | } |
730 | 707 | info = wlp->dev_info; |
731 | - d_printf(6, dev, "Local properties:\n" | |
732 | - "Device name (%d bytes): %s\n" | |
733 | - "Model name (%d bytes): %s\n" | |
734 | - "Manufacturer (%d bytes): %s\n" | |
735 | - "Model number (%d bytes): %s\n" | |
736 | - "Serial number (%d bytes): %s\n" | |
737 | - "Primary device type: \n" | |
738 | - " Category: %d \n" | |
739 | - " OUI: %02x:%02x:%02x \n" | |
740 | - " OUI Subdivision: %u \n", | |
741 | - (int)strlen(info->name), info->name, | |
742 | - (int)strlen(info->model_name), info->model_name, | |
743 | - (int)strlen(info->manufacturer), info->manufacturer, | |
744 | - (int)strlen(info->model_nr), info->model_nr, | |
745 | - (int)strlen(info->serial), info->serial, | |
746 | - info->prim_dev_type.category, | |
747 | - info->prim_dev_type.OUI[0], info->prim_dev_type.OUI[1], | |
748 | - info->prim_dev_type.OUI[2], info->prim_dev_type.OUIsubdiv); | |
749 | 708 | _skb = dev_alloc_skb(sizeof(*_d1) |
750 | 709 | + sizeof(struct wlp_attr_uuid_e) |
751 | 710 | + sizeof(struct wlp_attr_wss_sel_mthd) |
... | ... | @@ -768,7 +727,6 @@ |
768 | 727 | goto error; |
769 | 728 | } |
770 | 729 | _d1 = (void *) _skb->data; |
771 | - d_printf(6, dev, "D1 starts at %p \n", _d1); | |
772 | 730 | _d1->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
773 | 731 | _d1->hdr.type = WLP_FRAME_ASSOCIATION; |
774 | 732 | _d1->type = WLP_ASSOC_D1; |
775 | 733 | |
... | ... | @@ -791,25 +749,8 @@ |
791 | 749 | used += wlp_set_prim_dev_type(d1_itr + used, &info->prim_dev_type); |
792 | 750 | used += wlp_set_wlp_assc_err(d1_itr + used, WLP_ASSOC_ERROR_NONE); |
793 | 751 | skb_put(_skb, sizeof(*_d1) + used); |
794 | - d_printf(6, dev, "D1 message:\n"); | |
795 | - d_dump(6, dev, _d1, sizeof(*_d1) | |
796 | - + sizeof(struct wlp_attr_uuid_e) | |
797 | - + sizeof(struct wlp_attr_wss_sel_mthd) | |
798 | - + sizeof(struct wlp_attr_dev_name) | |
799 | - + strlen(info->name) | |
800 | - + sizeof(struct wlp_attr_manufacturer) | |
801 | - + strlen(info->manufacturer) | |
802 | - + sizeof(struct wlp_attr_model_name) | |
803 | - + strlen(info->model_name) | |
804 | - + sizeof(struct wlp_attr_model_nr) | |
805 | - + strlen(info->model_nr) | |
806 | - + sizeof(struct wlp_attr_serial) | |
807 | - + strlen(info->serial) | |
808 | - + sizeof(struct wlp_attr_prim_dev_type) | |
809 | - + sizeof(struct wlp_attr_wlp_assc_err)); | |
810 | 752 | *skb = _skb; |
811 | 753 | error: |
812 | - d_fnend(6, dev, "wlp %p, result = %d\n", wlp, result); | |
813 | 754 | return result; |
814 | 755 | } |
815 | 756 | |
... | ... | @@ -837,7 +778,6 @@ |
837 | 778 | void *d2_itr; |
838 | 779 | size_t mem_needed; |
839 | 780 | |
840 | - d_fnstart(6, dev, "wlp %p\n", wlp); | |
841 | 781 | if (wlp->dev_info == NULL) { |
842 | 782 | result = __wlp_setup_device_info(wlp); |
843 | 783 | if (result < 0) { |
... | ... | @@ -847,24 +787,6 @@ |
847 | 787 | } |
848 | 788 | } |
849 | 789 | info = wlp->dev_info; |
850 | - d_printf(6, dev, "Local properties:\n" | |
851 | - "Device name (%d bytes): %s\n" | |
852 | - "Model name (%d bytes): %s\n" | |
853 | - "Manufacturer (%d bytes): %s\n" | |
854 | - "Model number (%d bytes): %s\n" | |
855 | - "Serial number (%d bytes): %s\n" | |
856 | - "Primary device type: \n" | |
857 | - " Category: %d \n" | |
858 | - " OUI: %02x:%02x:%02x \n" | |
859 | - " OUI Subdivision: %u \n", | |
860 | - (int)strlen(info->name), info->name, | |
861 | - (int)strlen(info->model_name), info->model_name, | |
862 | - (int)strlen(info->manufacturer), info->manufacturer, | |
863 | - (int)strlen(info->model_nr), info->model_nr, | |
864 | - (int)strlen(info->serial), info->serial, | |
865 | - info->prim_dev_type.category, | |
866 | - info->prim_dev_type.OUI[0], info->prim_dev_type.OUI[1], | |
867 | - info->prim_dev_type.OUI[2], info->prim_dev_type.OUIsubdiv); | |
868 | 790 | mem_needed = sizeof(*_d2) |
869 | 791 | + sizeof(struct wlp_attr_uuid_e) |
870 | 792 | + sizeof(struct wlp_attr_uuid_r) |
... | ... | @@ -892,7 +814,6 @@ |
892 | 814 | goto error; |
893 | 815 | } |
894 | 816 | _d2 = (void *) _skb->data; |
895 | - d_printf(6, dev, "D2 starts at %p \n", _d2); | |
896 | 817 | _d2->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
897 | 818 | _d2->hdr.type = WLP_FRAME_ASSOCIATION; |
898 | 819 | _d2->type = WLP_ASSOC_D2; |
899 | 820 | |
... | ... | @@ -917,11 +838,8 @@ |
917 | 838 | used += wlp_set_prim_dev_type(d2_itr + used, &info->prim_dev_type); |
918 | 839 | used += wlp_set_wlp_assc_err(d2_itr + used, WLP_ASSOC_ERROR_NONE); |
919 | 840 | skb_put(_skb, sizeof(*_d2) + used); |
920 | - d_printf(6, dev, "D2 message:\n"); | |
921 | - d_dump(6, dev, _d2, mem_needed); | |
922 | 841 | *skb = _skb; |
923 | 842 | error: |
924 | - d_fnend(6, dev, "wlp %p, result = %d\n", wlp, result); | |
925 | 843 | return result; |
926 | 844 | } |
927 | 845 | |
... | ... | @@ -947,7 +865,6 @@ |
947 | 865 | struct sk_buff *_skb; |
948 | 866 | struct wlp_nonce tmp; |
949 | 867 | |
950 | - d_fnstart(6, dev, "wlp %p\n", wlp); | |
951 | 868 | _skb = dev_alloc_skb(sizeof(*f0)); |
952 | 869 | if (_skb == NULL) { |
953 | 870 | dev_err(dev, "WLP: Unable to allocate memory for F0 " |
... | ... | @@ -955,7 +872,6 @@ |
955 | 872 | goto error_alloc; |
956 | 873 | } |
957 | 874 | f0 = (void *) _skb->data; |
958 | - d_printf(6, dev, "F0 starts at %p \n", f0); | |
959 | 875 | f0->f0_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
960 | 876 | f0->f0_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
961 | 877 | f0->f0_hdr.type = WLP_ASSOC_F0; |
... | ... | @@ -969,7 +885,6 @@ |
969 | 885 | *skb = _skb; |
970 | 886 | result = 0; |
971 | 887 | error_alloc: |
972 | - d_fnend(6, dev, "wlp %p, result %d \n", wlp, result); | |
973 | 888 | return result; |
974 | 889 | } |
975 | 890 | |
976 | 891 | |
... | ... | @@ -1242,12 +1157,9 @@ |
1242 | 1157 | enum wlp_wss_sel_mthd sel_mthd = 0; |
1243 | 1158 | struct wlp_device_info dev_info; |
1244 | 1159 | enum wlp_assc_error assc_err; |
1245 | - char uuid[WLP_WSS_UUID_STRSIZE]; | |
1246 | 1160 | struct sk_buff *resp = NULL; |
1247 | 1161 | |
1248 | 1162 | /* Parse D1 frame */ |
1249 | - d_fnstart(6, dev, "WLP: handle D1 frame. wlp = %p, skb = %p\n", | |
1250 | - wlp, skb); | |
1251 | 1163 | mutex_lock(&wss->mutex); |
1252 | 1164 | mutex_lock(&wlp->mutex); /* to access wlp->uuid */ |
1253 | 1165 | memset(&dev_info, 0, sizeof(dev_info)); |
... | ... | @@ -1258,30 +1170,6 @@ |
1258 | 1170 | kfree_skb(skb); |
1259 | 1171 | goto out; |
1260 | 1172 | } |
1261 | - wlp_wss_uuid_print(uuid, sizeof(uuid), &uuid_e); | |
1262 | - d_printf(6, dev, "From D1 frame:\n" | |
1263 | - "UUID-E: %s\n" | |
1264 | - "Selection method: %d\n" | |
1265 | - "Device name (%d bytes): %s\n" | |
1266 | - "Model name (%d bytes): %s\n" | |
1267 | - "Manufacturer (%d bytes): %s\n" | |
1268 | - "Model number (%d bytes): %s\n" | |
1269 | - "Serial number (%d bytes): %s\n" | |
1270 | - "Primary device type: \n" | |
1271 | - " Category: %d \n" | |
1272 | - " OUI: %02x:%02x:%02x \n" | |
1273 | - " OUI Subdivision: %u \n", | |
1274 | - uuid, sel_mthd, | |
1275 | - (int)strlen(dev_info.name), dev_info.name, | |
1276 | - (int)strlen(dev_info.model_name), dev_info.model_name, | |
1277 | - (int)strlen(dev_info.manufacturer), dev_info.manufacturer, | |
1278 | - (int)strlen(dev_info.model_nr), dev_info.model_nr, | |
1279 | - (int)strlen(dev_info.serial), dev_info.serial, | |
1280 | - dev_info.prim_dev_type.category, | |
1281 | - dev_info.prim_dev_type.OUI[0], | |
1282 | - dev_info.prim_dev_type.OUI[1], | |
1283 | - dev_info.prim_dev_type.OUI[2], | |
1284 | - dev_info.prim_dev_type.OUIsubdiv); | |
1285 | 1173 | |
1286 | 1174 | kfree_skb(skb); |
1287 | 1175 | if (!wlp_uuid_is_set(&wlp->uuid)) { |
... | ... | @@ -1316,7 +1204,6 @@ |
1316 | 1204 | kfree(frame_ctx); |
1317 | 1205 | mutex_unlock(&wlp->mutex); |
1318 | 1206 | mutex_unlock(&wss->mutex); |
1319 | - d_fnend(6, dev, "WLP: handle D1 frame. wlp = %p\n", wlp); | |
1320 | 1207 | } |
1321 | 1208 | |
1322 | 1209 | /** |
1323 | 1210 | |
... | ... | @@ -1546,10 +1433,8 @@ |
1546 | 1433 | void *ptr = skb->data; |
1547 | 1434 | size_t len = skb->len; |
1548 | 1435 | size_t used; |
1549 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
1550 | 1436 | struct wlp_frame_assoc *assoc = ptr; |
1551 | 1437 | |
1552 | - d_fnstart(6, dev, "wlp %p, skb %p \n", wlp, skb); | |
1553 | 1438 | used = sizeof(*assoc); |
1554 | 1439 | result = wlp_get_wssid(wlp, ptr + used, wssid, len - used); |
1555 | 1440 | if (result < 0) { |
1556 | 1441 | |
... | ... | @@ -1572,14 +1457,7 @@ |
1572 | 1457 | wlp_assoc_frame_str(assoc->type)); |
1573 | 1458 | goto error_parse; |
1574 | 1459 | } |
1575 | - wlp_wss_uuid_print(buf, sizeof(buf), wssid); | |
1576 | - d_printf(6, dev, "WLP: parsed: WSSID %s, tag 0x%02x, virt " | |
1577 | - "%02x:%02x:%02x:%02x:%02x:%02x \n", buf, *tag, | |
1578 | - virt_addr->data[0], virt_addr->data[1], virt_addr->data[2], | |
1579 | - virt_addr->data[3], virt_addr->data[4], virt_addr->data[5]); | |
1580 | - | |
1581 | 1460 | error_parse: |
1582 | - d_fnend(6, dev, "wlp %p, skb %p, result = %d \n", wlp, skb, result); | |
1583 | 1461 | return result; |
1584 | 1462 | } |
1585 | 1463 | |
... | ... | @@ -1600,7 +1478,6 @@ |
1600 | 1478 | } *c; |
1601 | 1479 | struct sk_buff *_skb; |
1602 | 1480 | |
1603 | - d_fnstart(6, dev, "wlp %p, wss %p \n", wlp, wss); | |
1604 | 1481 | _skb = dev_alloc_skb(sizeof(*c)); |
1605 | 1482 | if (_skb == NULL) { |
1606 | 1483 | dev_err(dev, "WLP: Unable to allocate memory for C1/C2 " |
... | ... | @@ -1608,7 +1485,6 @@ |
1608 | 1485 | goto error_alloc; |
1609 | 1486 | } |
1610 | 1487 | c = (void *) _skb->data; |
1611 | - d_printf(6, dev, "C1/C2 starts at %p \n", c); | |
1612 | 1488 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
1613 | 1489 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
1614 | 1490 | c->c_hdr.type = type; |
1615 | 1491 | |
... | ... | @@ -1616,12 +1492,9 @@ |
1616 | 1492 | wlp_set_msg_type(&c->c_hdr.msg_type, type); |
1617 | 1493 | wlp_set_wssid(&c->wssid, &wss->wssid); |
1618 | 1494 | skb_put(_skb, sizeof(*c)); |
1619 | - d_printf(6, dev, "C1/C2 message:\n"); | |
1620 | - d_dump(6, dev, c, sizeof(*c)); | |
1621 | 1495 | *skb = _skb; |
1622 | 1496 | result = 0; |
1623 | 1497 | error_alloc: |
1624 | - d_fnend(6, dev, "wlp %p, wss %p, result %d \n", wlp, wss, result); | |
1625 | 1498 | return result; |
1626 | 1499 | } |
1627 | 1500 | |
... | ... | @@ -1660,7 +1533,6 @@ |
1660 | 1533 | } *c; |
1661 | 1534 | struct sk_buff *_skb; |
1662 | 1535 | |
1663 | - d_fnstart(6, dev, "wlp %p, wss %p \n", wlp, wss); | |
1664 | 1536 | _skb = dev_alloc_skb(sizeof(*c)); |
1665 | 1537 | if (_skb == NULL) { |
1666 | 1538 | dev_err(dev, "WLP: Unable to allocate memory for C3/C4 " |
... | ... | @@ -1668,7 +1540,6 @@ |
1668 | 1540 | goto error_alloc; |
1669 | 1541 | } |
1670 | 1542 | c = (void *) _skb->data; |
1671 | - d_printf(6, dev, "C3/C4 starts at %p \n", c); | |
1672 | 1543 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
1673 | 1544 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
1674 | 1545 | c->c_hdr.type = type; |
1675 | 1546 | |
... | ... | @@ -1678,12 +1549,9 @@ |
1678 | 1549 | wlp_set_wss_tag(&c->wss_tag, wss->tag); |
1679 | 1550 | wlp_set_wss_virt(&c->wss_virt, &wss->virtual_addr); |
1680 | 1551 | skb_put(_skb, sizeof(*c)); |
1681 | - d_printf(6, dev, "C3/C4 message:\n"); | |
1682 | - d_dump(6, dev, c, sizeof(*c)); | |
1683 | 1552 | *skb = _skb; |
1684 | 1553 | result = 0; |
1685 | 1554 | error_alloc: |
1686 | - d_fnend(6, dev, "wlp %p, wss %p, result %d \n", wlp, wss, result); | |
1687 | 1555 | return result; |
1688 | 1556 | } |
1689 | 1557 | |
... | ... | @@ -1709,10 +1577,7 @@ |
1709 | 1577 | struct device *dev = &wlp->rc->uwb_dev.dev; \ |
1710 | 1578 | int result; \ |
1711 | 1579 | struct sk_buff *skb = NULL; \ |
1712 | - d_fnstart(6, dev, "wlp %p, wss %p, neighbor: %02x:%02x\n", \ | |
1713 | - wlp, wss, dev_addr->data[1], dev_addr->data[0]); \ | |
1714 | - d_printf(6, dev, "WLP: Constructing %s frame. \n", \ | |
1715 | - wlp_assoc_frame_str(id)); \ | |
1580 | + \ | |
1716 | 1581 | /* Build the frame */ \ |
1717 | 1582 | result = wlp_build_assoc_##type(wlp, wss, &skb); \ |
1718 | 1583 | if (result < 0) { \ |
... | ... | @@ -1721,9 +1586,6 @@ |
1721 | 1586 | goto error_build_assoc; \ |
1722 | 1587 | } \ |
1723 | 1588 | /* Send the frame */ \ |
1724 | - d_printf(6, dev, "Transmitting %s frame to %02x:%02x \n", \ | |
1725 | - wlp_assoc_frame_str(id), \ | |
1726 | - dev_addr->data[1], dev_addr->data[0]); \ | |
1727 | 1589 | BUG_ON(wlp->xmit_frame == NULL); \ |
1728 | 1590 | result = wlp->xmit_frame(wlp, skb, dev_addr); \ |
1729 | 1591 | if (result < 0) { \ |
... | ... | @@ -1740,8 +1602,6 @@ |
1740 | 1602 | /* We could try again ... */ \ |
1741 | 1603 | dev_kfree_skb_any(skb);/*we need to free if tx fails*/ \ |
1742 | 1604 | error_build_assoc: \ |
1743 | - d_fnend(6, dev, "wlp %p, wss %p, neighbor: %02x:%02x\n", \ | |
1744 | - wlp, wss, dev_addr->data[1], dev_addr->data[0]); \ | |
1745 | 1605 | return result; \ |
1746 | 1606 | } |
1747 | 1607 | |
1748 | 1608 | |
... | ... | @@ -1794,12 +1654,9 @@ |
1794 | 1654 | struct uwb_dev_addr *src = &frame_ctx->src; |
1795 | 1655 | int result; |
1796 | 1656 | struct wlp_uuid wssid; |
1797 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
1798 | 1657 | struct sk_buff *resp = NULL; |
1799 | 1658 | |
1800 | 1659 | /* Parse C1 frame */ |
1801 | - d_fnstart(6, dev, "WLP: handle C1 frame. wlp = %p, c1 = %p\n", | |
1802 | - wlp, c1); | |
1803 | 1660 | mutex_lock(&wss->mutex); |
1804 | 1661 | result = wlp_get_wssid(wlp, (void *)c1 + sizeof(*c1), &wssid, |
1805 | 1662 | len - sizeof(*c1)); |
1806 | 1663 | |
... | ... | @@ -1807,12 +1664,8 @@ |
1807 | 1664 | dev_err(dev, "WLP: unable to obtain WSSID from C1 frame.\n"); |
1808 | 1665 | goto out; |
1809 | 1666 | } |
1810 | - wlp_wss_uuid_print(buf, sizeof(buf), &wssid); | |
1811 | - d_printf(6, dev, "Received C1 frame with WSSID %s \n", buf); | |
1812 | 1667 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) |
1813 | 1668 | && wss->state == WLP_WSS_STATE_ACTIVE) { |
1814 | - d_printf(6, dev, "WSSID from C1 frame is known locally " | |
1815 | - "and is active\n"); | |
1816 | 1669 | /* Construct C2 frame */ |
1817 | 1670 | result = wlp_build_assoc_c2(wlp, wss, &resp); |
1818 | 1671 | if (result < 0) { |
... | ... | @@ -1820,8 +1673,6 @@ |
1820 | 1673 | goto out; |
1821 | 1674 | } |
1822 | 1675 | } else { |
1823 | - d_printf(6, dev, "WSSID from C1 frame is not known locally " | |
1824 | - "or is not active\n"); | |
1825 | 1676 | /* Construct F0 frame */ |
1826 | 1677 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); |
1827 | 1678 | if (result < 0) { |
... | ... | @@ -1830,8 +1681,6 @@ |
1830 | 1681 | } |
1831 | 1682 | } |
1832 | 1683 | /* Send C2 frame */ |
1833 | - d_printf(6, dev, "Transmitting response (C2/F0) frame to %02x:%02x \n", | |
1834 | - src->data[1], src->data[0]); | |
1835 | 1684 | BUG_ON(wlp->xmit_frame == NULL); |
1836 | 1685 | result = wlp->xmit_frame(wlp, resp, src); |
1837 | 1686 | if (result < 0) { |
... | ... | @@ -1846,7 +1695,6 @@ |
1846 | 1695 | kfree_skb(frame_ctx->skb); |
1847 | 1696 | kfree(frame_ctx); |
1848 | 1697 | mutex_unlock(&wss->mutex); |
1849 | - d_fnend(6, dev, "WLP: handle C1 frame. wlp = %p\n", wlp); | |
1850 | 1698 | } |
1851 | 1699 | |
1852 | 1700 | /** |
1853 | 1701 | |
1854 | 1702 | |
1855 | 1703 | |
... | ... | @@ -1868,27 +1716,20 @@ |
1868 | 1716 | struct sk_buff *skb = frame_ctx->skb; |
1869 | 1717 | struct uwb_dev_addr *src = &frame_ctx->src; |
1870 | 1718 | int result; |
1871 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
1872 | 1719 | struct sk_buff *resp = NULL; |
1873 | 1720 | struct wlp_uuid wssid; |
1874 | 1721 | u8 tag; |
1875 | 1722 | struct uwb_mac_addr virt_addr; |
1876 | 1723 | |
1877 | 1724 | /* Parse C3 frame */ |
1878 | - d_fnstart(6, dev, "WLP: handle C3 frame. wlp = %p, skb = %p\n", | |
1879 | - wlp, skb); | |
1880 | 1725 | mutex_lock(&wss->mutex); |
1881 | 1726 | result = wlp_parse_c3c4_frame(wlp, skb, &wssid, &tag, &virt_addr); |
1882 | 1727 | if (result < 0) { |
1883 | 1728 | dev_err(dev, "WLP: unable to obtain values from C3 frame.\n"); |
1884 | 1729 | goto out; |
1885 | 1730 | } |
1886 | - wlp_wss_uuid_print(buf, sizeof(buf), &wssid); | |
1887 | - d_printf(6, dev, "Received C3 frame with WSSID %s \n", buf); | |
1888 | 1731 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) |
1889 | 1732 | && wss->state >= WLP_WSS_STATE_ACTIVE) { |
1890 | - d_printf(6, dev, "WSSID from C3 frame is known locally " | |
1891 | - "and is active\n"); | |
1892 | 1733 | result = wlp_eda_update_node(&wlp->eda, src, wss, |
1893 | 1734 | (void *) virt_addr.data, tag, |
1894 | 1735 | WLP_WSS_CONNECTED); |
... | ... | @@ -1913,8 +1754,6 @@ |
1913 | 1754 | } |
1914 | 1755 | } |
1915 | 1756 | } else { |
1916 | - d_printf(6, dev, "WSSID from C3 frame is not known locally " | |
1917 | - "or is not active\n"); | |
1918 | 1757 | /* Construct F0 frame */ |
1919 | 1758 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); |
1920 | 1759 | if (result < 0) { |
... | ... | @@ -1923,8 +1762,6 @@ |
1923 | 1762 | } |
1924 | 1763 | } |
1925 | 1764 | /* Send C4 frame */ |
1926 | - d_printf(6, dev, "Transmitting response (C4/F0) frame to %02x:%02x \n", | |
1927 | - src->data[1], src->data[0]); | |
1928 | 1765 | BUG_ON(wlp->xmit_frame == NULL); |
1929 | 1766 | result = wlp->xmit_frame(wlp, resp, src); |
1930 | 1767 | if (result < 0) { |
... | ... | @@ -1939,7 +1776,5 @@ |
1939 | 1776 | kfree_skb(frame_ctx->skb); |
1940 | 1777 | kfree(frame_ctx); |
1941 | 1778 | mutex_unlock(&wss->mutex); |
1942 | - d_fnend(6, dev, "WLP: handle C3 frame. wlp = %p, skb = %p\n", | |
1943 | - wlp, skb); | |
1944 | 1779 | } |
drivers/uwb/wlp/sysfs.c
drivers/uwb/wlp/txrx.c
... | ... | @@ -26,12 +26,10 @@ |
26 | 26 | |
27 | 27 | #include <linux/etherdevice.h> |
28 | 28 | #include <linux/wlp.h> |
29 | -#define D_LOCAL 5 | |
30 | -#include <linux/uwb/debug.h> | |
29 | + | |
31 | 30 | #include "wlp-internal.h" |
32 | 31 | |
33 | - | |
34 | -/** | |
32 | +/* | |
35 | 33 | * Direct incoming association msg to correct parsing routine |
36 | 34 | * |
37 | 35 | * We only expect D1, E1, C1, C3 messages as new. All other incoming |
38 | 36 | |
39 | 37 | |
40 | 38 | |
41 | 39 | |
42 | 40 | |
... | ... | @@ -48,35 +46,31 @@ |
48 | 46 | struct device *dev = &wlp->rc->uwb_dev.dev; |
49 | 47 | struct wlp_frame_assoc *assoc = (void *) skb->data; |
50 | 48 | struct wlp_assoc_frame_ctx *frame_ctx; |
51 | - d_fnstart(5, dev, "wlp %p, skb %p\n", wlp, skb); | |
49 | + | |
52 | 50 | frame_ctx = kmalloc(sizeof(*frame_ctx), GFP_ATOMIC); |
53 | 51 | if (frame_ctx == NULL) { |
54 | 52 | dev_err(dev, "WLP: Unable to allocate memory for association " |
55 | 53 | "frame handling.\n"); |
56 | 54 | kfree_skb(skb); |
57 | - goto out; | |
55 | + return; | |
58 | 56 | } |
59 | 57 | frame_ctx->wlp = wlp; |
60 | 58 | frame_ctx->skb = skb; |
61 | 59 | frame_ctx->src = *src; |
62 | 60 | switch (assoc->type) { |
63 | 61 | case WLP_ASSOC_D1: |
64 | - d_printf(5, dev, "Received a D1 frame.\n"); | |
65 | 62 | INIT_WORK(&frame_ctx->ws, wlp_handle_d1_frame); |
66 | 63 | schedule_work(&frame_ctx->ws); |
67 | 64 | break; |
68 | 65 | case WLP_ASSOC_E1: |
69 | - d_printf(5, dev, "Received a E1 frame. FIXME?\n"); | |
70 | 66 | kfree_skb(skb); /* Temporary until we handle it */ |
71 | 67 | kfree(frame_ctx); /* Temporary until we handle it */ |
72 | 68 | break; |
73 | 69 | case WLP_ASSOC_C1: |
74 | - d_printf(5, dev, "Received a C1 frame.\n"); | |
75 | 70 | INIT_WORK(&frame_ctx->ws, wlp_handle_c1_frame); |
76 | 71 | schedule_work(&frame_ctx->ws); |
77 | 72 | break; |
78 | 73 | case WLP_ASSOC_C3: |
79 | - d_printf(5, dev, "Received a C3 frame.\n"); | |
80 | 74 | INIT_WORK(&frame_ctx->ws, wlp_handle_c3_frame); |
81 | 75 | schedule_work(&frame_ctx->ws); |
82 | 76 | break; |
83 | 77 | |
... | ... | @@ -87,11 +81,9 @@ |
87 | 81 | kfree(frame_ctx); |
88 | 82 | break; |
89 | 83 | } |
90 | -out: | |
91 | - d_fnend(5, dev, "wlp %p\n", wlp); | |
92 | 84 | } |
93 | 85 | |
94 | -/** | |
86 | +/* | |
95 | 87 | * Process incoming association frame |
96 | 88 | * |
97 | 89 | * Although it could be possible to deal with some incoming association |
... | ... | @@ -112,7 +104,6 @@ |
112 | 104 | struct wlp_frame_assoc *assoc = (void *) skb->data; |
113 | 105 | struct wlp_session *session = wlp->session; |
114 | 106 | u8 version; |
115 | - d_fnstart(5, dev, "wlp %p, skb %p\n", wlp, skb); | |
116 | 107 | |
117 | 108 | if (wlp_get_version(wlp, &assoc->version, &version, |
118 | 109 | sizeof(assoc->version)) < 0) |
119 | 110 | |
120 | 111 | |
... | ... | @@ -150,14 +141,12 @@ |
150 | 141 | } else { |
151 | 142 | wlp_direct_assoc_frame(wlp, skb, src); |
152 | 143 | } |
153 | - d_fnend(5, dev, "wlp %p\n", wlp); | |
154 | 144 | return; |
155 | 145 | error: |
156 | 146 | kfree_skb(skb); |
157 | - d_fnend(5, dev, "wlp %p\n", wlp); | |
158 | 147 | } |
159 | 148 | |
160 | -/** | |
149 | +/* | |
161 | 150 | * Verify incoming frame is from connected neighbor, prep to pass to WLP client |
162 | 151 | * |
163 | 152 | * Verification proceeds according to WLP 0.99 [7.3.1]. The source address |
... | ... | @@ -176,7 +165,6 @@ |
176 | 165 | struct wlp_eda_node eda_entry; |
177 | 166 | struct wlp_frame_std_abbrv_hdr *hdr = (void *) skb->data; |
178 | 167 | |
179 | - d_fnstart(6, dev, "wlp %p, skb %p \n", wlp, skb); | |
180 | 168 | /*verify*/ |
181 | 169 | result = wlp_copy_eda_node(&wlp->eda, src, &eda_entry); |
182 | 170 | if (result < 0) { |
183 | 171 | |
... | ... | @@ -207,11 +195,10 @@ |
207 | 195 | /*prep*/ |
208 | 196 | skb_pull(skb, sizeof(*hdr)); |
209 | 197 | out: |
210 | - d_fnend(6, dev, "wlp %p, skb %p, result = %d \n", wlp, skb, result); | |
211 | 198 | return result; |
212 | 199 | } |
213 | 200 | |
214 | -/** | |
201 | +/* | |
215 | 202 | * Receive a WLP frame from device |
216 | 203 | * |
217 | 204 | * @returns: 1 if calling function should free the skb |
218 | 205 | |
... | ... | @@ -226,14 +213,12 @@ |
226 | 213 | struct wlp_frame_hdr *hdr; |
227 | 214 | int result = 0; |
228 | 215 | |
229 | - d_fnstart(6, dev, "skb (%p), len (%u)\n", skb, len); | |
230 | 216 | if (len < sizeof(*hdr)) { |
231 | 217 | dev_err(dev, "Not enough data to parse WLP header.\n"); |
232 | 218 | result = -EINVAL; |
233 | 219 | goto out; |
234 | 220 | } |
235 | 221 | hdr = ptr; |
236 | - d_dump(6, dev, hdr, sizeof(*hdr)); | |
237 | 222 | if (le16_to_cpu(hdr->mux_hdr) != WLP_PROTOCOL_ID) { |
238 | 223 | dev_err(dev, "Not a WLP frame type.\n"); |
239 | 224 | result = -EINVAL; |
... | ... | @@ -270,7 +255,6 @@ |
270 | 255 | "WLP header.\n"); |
271 | 256 | goto out; |
272 | 257 | } |
273 | - d_printf(5, dev, "Association frame received.\n"); | |
274 | 258 | wlp_receive_assoc_frame(wlp, skb, src); |
275 | 259 | break; |
276 | 260 | default: |
277 | 261 | |
... | ... | @@ -283,13 +267,12 @@ |
283 | 267 | kfree_skb(skb); |
284 | 268 | result = 0; |
285 | 269 | } |
286 | - d_fnend(6, dev, "skb (%p)\n", skb); | |
287 | 270 | return result; |
288 | 271 | } |
289 | 272 | EXPORT_SYMBOL_GPL(wlp_receive_frame); |
290 | 273 | |
291 | 274 | |
292 | -/** | |
275 | +/* | |
293 | 276 | * Verify frame from network stack, prepare for further transmission |
294 | 277 | * |
295 | 278 | * @skb: the socket buffer that needs to be prepared for transmission (it |
296 | 279 | |
... | ... | @@ -343,9 +326,7 @@ |
343 | 326 | int result = -EINVAL; |
344 | 327 | struct ethhdr *eth_hdr = (void *) skb->data; |
345 | 328 | |
346 | - d_fnstart(6, dev, "wlp (%p), skb (%p) \n", wlp, skb); | |
347 | 329 | if (is_broadcast_ether_addr(eth_hdr->h_dest)) { |
348 | - d_printf(6, dev, "WLP: handling broadcast frame. \n"); | |
349 | 330 | result = wlp_eda_for_each(&wlp->eda, wlp_wss_send_copy, skb); |
350 | 331 | if (result < 0) { |
351 | 332 | if (printk_ratelimit()) |
... | ... | @@ -357,7 +338,6 @@ |
357 | 338 | result = 1; |
358 | 339 | /* Frame will be transmitted by WLP. */ |
359 | 340 | } else { |
360 | - d_printf(6, dev, "WLP: handling unicast frame. \n"); | |
361 | 341 | result = wlp_eda_for_virtual(&wlp->eda, eth_hdr->h_dest, dst, |
362 | 342 | wlp_wss_prep_hdr, skb); |
363 | 343 | if (unlikely(result < 0)) { |
... | ... | @@ -368,7 +348,6 @@ |
368 | 348 | } |
369 | 349 | } |
370 | 350 | out: |
371 | - d_fnend(6, dev, "wlp (%p), skb (%p). result = %d \n", wlp, skb, result); | |
372 | 351 | return result; |
373 | 352 | } |
374 | 353 | EXPORT_SYMBOL_GPL(wlp_prepare_tx_frame); |
drivers/uwb/wlp/wlp-lc.c
... | ... | @@ -21,13 +21,10 @@ |
21 | 21 | * |
22 | 22 | * FIXME: docs |
23 | 23 | */ |
24 | - | |
25 | 24 | #include <linux/wlp.h> |
26 | -#define D_LOCAL 6 | |
27 | -#include <linux/uwb/debug.h> | |
25 | + | |
28 | 26 | #include "wlp-internal.h" |
29 | 27 | |
30 | - | |
31 | 28 | static |
32 | 29 | void wlp_neighbor_init(struct wlp_neighbor_e *neighbor) |
33 | 30 | { |
... | ... | @@ -61,11 +58,6 @@ |
61 | 58 | static |
62 | 59 | void __wlp_fill_device_info(struct wlp *wlp) |
63 | 60 | { |
64 | - struct device *dev = &wlp->rc->uwb_dev.dev; | |
65 | - | |
66 | - BUG_ON(wlp->fill_device_info == NULL); | |
67 | - d_printf(6, dev, "Retrieving device information " | |
68 | - "from device driver.\n"); | |
69 | 61 | wlp->fill_device_info(wlp, wlp->dev_info); |
70 | 62 | } |
71 | 63 | |
... | ... | @@ -127,7 +119,7 @@ |
127 | 119 | } |
128 | 120 | } |
129 | 121 | |
130 | -/** | |
122 | +/* | |
131 | 123 | * Populate WLP neighborhood cache with neighbor information |
132 | 124 | * |
133 | 125 | * A new neighbor is found. If it is discoverable then we add it to the |
... | ... | @@ -141,10 +133,7 @@ |
141 | 133 | int discoverable; |
142 | 134 | struct wlp_neighbor_e *neighbor; |
143 | 135 | |
144 | - d_fnstart(6, &dev->dev, "uwb %p \n", dev); | |
145 | - d_printf(6, &dev->dev, "Found neighbor device %02x:%02x \n", | |
146 | - dev->dev_addr.data[1], dev->dev_addr.data[0]); | |
147 | - /** | |
136 | + /* | |
148 | 137 | * FIXME: |
149 | 138 | * Use contents of WLP IE found in beacon cache to determine if |
150 | 139 | * neighbor is discoverable. |
... | ... | @@ -167,7 +156,6 @@ |
167 | 156 | list_add(&neighbor->node, &wlp->neighbors); |
168 | 157 | } |
169 | 158 | error_no_mem: |
170 | - d_fnend(6, &dev->dev, "uwb %p, result = %d \n", dev, result); | |
171 | 159 | return result; |
172 | 160 | } |
173 | 161 | |
... | ... | @@ -255,8 +243,6 @@ |
255 | 243 | dev_err(dev, "Unable to send D1 frame to neighbor " |
256 | 244 | "%02x:%02x (%d)\n", dev_addr->data[1], |
257 | 245 | dev_addr->data[0], result); |
258 | - d_printf(6, dev, "Add placeholders into buffer next to " | |
259 | - "neighbor information we have (dev address).\n"); | |
260 | 246 | goto out; |
261 | 247 | } |
262 | 248 | /* Create session, wait for response */ |
... | ... | @@ -284,8 +270,6 @@ |
284 | 270 | /* Parse message in session->data: it will be either D2 or F0 */ |
285 | 271 | skb = session.data; |
286 | 272 | resp = (void *) skb->data; |
287 | - d_printf(6, dev, "Received response to D1 frame. \n"); | |
288 | - d_dump(6, dev, skb->data, skb->len > 72 ? 72 : skb->len); | |
289 | 273 | |
290 | 274 | if (resp->type == WLP_ASSOC_F0) { |
291 | 275 | result = wlp_parse_f0(wlp, skb); |
292 | 276 | |
... | ... | @@ -337,10 +321,9 @@ |
337 | 321 | struct device *dev = &wlp->rc->uwb_dev.dev; |
338 | 322 | char buf[WLP_WSS_UUID_STRSIZE]; |
339 | 323 | struct uwb_dev_addr *dev_addr = &neighbor->uwb_dev->dev_addr; |
324 | + | |
340 | 325 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
341 | - d_fnstart(6, dev, "wlp %p, neighbor %p, wss %p, wssid %p (%s)\n", | |
342 | - wlp, neighbor, wss, wssid, buf); | |
343 | - d_printf(6, dev, "Complete me.\n"); | |
326 | + | |
344 | 327 | result = wlp_d1d2_exchange(wlp, neighbor, wss, wssid); |
345 | 328 | if (result < 0) { |
346 | 329 | dev_err(dev, "WLP: D1/D2 message exchange for enrollment " |
347 | 330 | |
... | ... | @@ -360,13 +343,10 @@ |
360 | 343 | goto error; |
361 | 344 | } else { |
362 | 345 | wss->state = WLP_WSS_STATE_ENROLLED; |
363 | - d_printf(2, dev, "WLP: Success Enrollment into unsecure WSS " | |
364 | - "%s using neighbor %02x:%02x. \n", buf, | |
365 | - dev_addr->data[1], dev_addr->data[0]); | |
346 | + dev_dbg(dev, "WLP: Success Enrollment into unsecure WSS " | |
347 | + "%s using neighbor %02x:%02x. \n", | |
348 | + buf, dev_addr->data[1], dev_addr->data[0]); | |
366 | 349 | } |
367 | - | |
368 | - d_fnend(6, dev, "wlp %p, neighbor %p, wss %p, wssid %p (%s)\n", | |
369 | - wlp, neighbor, wss, wssid, buf); | |
370 | 350 | out: |
371 | 351 | return result; |
372 | 352 | error: |
... | ... | @@ -449,7 +429,6 @@ |
449 | 429 | int result = 0; |
450 | 430 | struct device *dev = &wlp->rc->uwb_dev.dev; |
451 | 431 | |
452 | - d_fnstart(6, dev, "wlp %p \n", wlp); | |
453 | 432 | mutex_lock(&wlp->nbmutex); |
454 | 433 | /* Clear current neighborhood cache. */ |
455 | 434 | __wlp_neighbors_release(wlp); |
... | ... | @@ -469,7 +448,6 @@ |
469 | 448 | } |
470 | 449 | error_dev_for_each: |
471 | 450 | mutex_unlock(&wlp->nbmutex); |
472 | - d_fnend(6, dev, "wlp %p \n", wlp); | |
473 | 451 | return result; |
474 | 452 | } |
475 | 453 | |
... | ... | @@ -492,9 +470,6 @@ |
492 | 470 | int result; |
493 | 471 | switch (event) { |
494 | 472 | case UWB_NOTIF_ONAIR: |
495 | - d_printf(6, dev, "UWB device %02x:%02x is onair\n", | |
496 | - uwb_dev->dev_addr.data[1], | |
497 | - uwb_dev->dev_addr.data[0]); | |
498 | 473 | result = wlp_eda_create_node(&wlp->eda, |
499 | 474 | uwb_dev->mac_addr.data, |
500 | 475 | &uwb_dev->dev_addr); |
501 | 476 | |
502 | 477 | |
... | ... | @@ -505,18 +480,11 @@ |
505 | 480 | uwb_dev->dev_addr.data[0]); |
506 | 481 | break; |
507 | 482 | case UWB_NOTIF_OFFAIR: |
508 | - d_printf(6, dev, "UWB device %02x:%02x is offair\n", | |
509 | - uwb_dev->dev_addr.data[1], | |
510 | - uwb_dev->dev_addr.data[0]); | |
511 | 483 | wlp_eda_rm_node(&wlp->eda, &uwb_dev->dev_addr); |
512 | 484 | mutex_lock(&wlp->nbmutex); |
513 | - list_for_each_entry_safe(neighbor, next, &wlp->neighbors, | |
514 | - node) { | |
515 | - if (neighbor->uwb_dev == uwb_dev) { | |
516 | - d_printf(6, dev, "Removing device from " | |
517 | - "neighborhood.\n"); | |
485 | + list_for_each_entry_safe(neighbor, next, &wlp->neighbors, node) { | |
486 | + if (neighbor->uwb_dev == uwb_dev) | |
518 | 487 | __wlp_neighbor_release(neighbor); |
519 | - } | |
520 | 488 | } |
521 | 489 | mutex_unlock(&wlp->nbmutex); |
522 | 490 | break; |
523 | 491 | |
524 | 492 | |
... | ... | @@ -538,14 +506,13 @@ |
538 | 506 | |
539 | 507 | int wlp_setup(struct wlp *wlp, struct uwb_rc *rc, struct net_device *ndev) |
540 | 508 | { |
541 | - struct device *dev = &rc->uwb_dev.dev; | |
542 | 509 | int result; |
543 | 510 | |
544 | - d_fnstart(6, dev, "wlp %p\n", wlp); | |
545 | 511 | BUG_ON(wlp->fill_device_info == NULL); |
546 | 512 | BUG_ON(wlp->xmit_frame == NULL); |
547 | 513 | BUG_ON(wlp->stop_queue == NULL); |
548 | 514 | BUG_ON(wlp->start_queue == NULL); |
515 | + | |
549 | 516 | wlp->rc = rc; |
550 | 517 | wlp->ndev = ndev; |
551 | 518 | wlp_eda_init(&wlp->eda);/* Set up address cache */ |
552 | 519 | |
... | ... | @@ -560,15 +527,12 @@ |
560 | 527 | if (result < 0) |
561 | 528 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); |
562 | 529 | |
563 | - d_fnend(6, dev, "wlp %p, result = %d\n", wlp, result); | |
564 | 530 | return result; |
565 | 531 | } |
566 | 532 | EXPORT_SYMBOL_GPL(wlp_setup); |
567 | 533 | |
568 | 534 | void wlp_remove(struct wlp *wlp) |
569 | 535 | { |
570 | - struct device *dev = &wlp->rc->uwb_dev.dev; | |
571 | - d_fnstart(6, dev, "wlp %p\n", wlp); | |
572 | 536 | wlp_neighbors_release(wlp); |
573 | 537 | uwb_pal_unregister(&wlp->pal); |
574 | 538 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); |
... | ... | @@ -578,9 +542,6 @@ |
578 | 542 | kfree(wlp->dev_info); |
579 | 543 | mutex_unlock(&wlp->mutex); |
580 | 544 | wlp->rc = NULL; |
581 | - /* We have to use NULL here because this function can be called | |
582 | - * when the device disappeared. */ | |
583 | - d_fnend(6, NULL, "wlp %p\n", wlp); | |
584 | 545 | } |
585 | 546 | EXPORT_SYMBOL_GPL(wlp_remove); |
586 | 547 |
drivers/uwb/wlp/wss-lc.c
... | ... | @@ -43,15 +43,12 @@ |
43 | 43 | * wlp_wss_release() |
44 | 44 | * wlp_wss_reset() |
45 | 45 | */ |
46 | - | |
47 | 46 | #include <linux/etherdevice.h> /* for is_valid_ether_addr */ |
48 | 47 | #include <linux/skbuff.h> |
49 | 48 | #include <linux/wlp.h> |
50 | -#define D_LOCAL 5 | |
51 | -#include <linux/uwb/debug.h> | |
49 | + | |
52 | 50 | #include "wlp-internal.h" |
53 | 51 | |
54 | - | |
55 | 52 | size_t wlp_wss_key_print(char *buf, size_t bufsize, u8 *key) |
56 | 53 | { |
57 | 54 | size_t result; |
... | ... | @@ -116,9 +113,6 @@ |
116 | 113 | */ |
117 | 114 | void wlp_wss_reset(struct wlp_wss *wss) |
118 | 115 | { |
119 | - struct wlp *wlp = container_of(wss, struct wlp, wss); | |
120 | - struct device *dev = &wlp->rc->uwb_dev.dev; | |
121 | - d_fnstart(5, dev, "wss (%p) \n", wss); | |
122 | 116 | memset(&wss->wssid, 0, sizeof(wss->wssid)); |
123 | 117 | wss->hash = 0; |
124 | 118 | memset(&wss->name[0], 0, sizeof(wss->name)); |
... | ... | @@ -127,7 +121,6 @@ |
127 | 121 | memset(&wss->master_key[0], 0, sizeof(wss->master_key)); |
128 | 122 | wss->tag = 0; |
129 | 123 | wss->state = WLP_WSS_STATE_NONE; |
130 | - d_fnend(5, dev, "wss (%p) \n", wss); | |
131 | 124 | } |
132 | 125 | |
133 | 126 | /** |
... | ... | @@ -145,7 +138,6 @@ |
145 | 138 | struct device *dev = &wlp->rc->uwb_dev.dev; |
146 | 139 | int result; |
147 | 140 | |
148 | - d_fnstart(5, dev, "wss (%p), wssid: %s\n", wss, wssid_str); | |
149 | 141 | result = kobject_set_name(&wss->kobj, "wss-%s", wssid_str); |
150 | 142 | if (result < 0) |
151 | 143 | return result; |
... | ... | @@ -162,7 +154,6 @@ |
162 | 154 | result); |
163 | 155 | goto error_sysfs_create_group; |
164 | 156 | } |
165 | - d_fnend(5, dev, "Completed. result = %d \n", result); | |
166 | 157 | return 0; |
167 | 158 | error_sysfs_create_group: |
168 | 159 | |
169 | 160 | |
170 | 161 | |
... | ... | @@ -214,22 +205,14 @@ |
214 | 205 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
215 | 206 | struct device *dev = &wlp->rc->uwb_dev.dev; |
216 | 207 | struct wlp_neighbor_e *neighbor; |
217 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
218 | 208 | int result = -ENXIO; |
219 | 209 | struct uwb_dev_addr *dev_addr; |
220 | 210 | |
221 | - wlp_wss_uuid_print(buf, sizeof(buf), wssid); | |
222 | - d_fnstart(5, dev, "wss %p, wssid %s, registrar %02x:%02x \n", | |
223 | - wss, buf, dest->data[1], dest->data[0]); | |
224 | 211 | mutex_lock(&wlp->nbmutex); |
225 | 212 | list_for_each_entry(neighbor, &wlp->neighbors, node) { |
226 | 213 | dev_addr = &neighbor->uwb_dev->dev_addr; |
227 | 214 | if (!memcmp(dest, dev_addr, sizeof(*dest))) { |
228 | - d_printf(5, dev, "Neighbor %02x:%02x is valid, " | |
229 | - "enrolling. \n", | |
230 | - dev_addr->data[1], dev_addr->data[0]); | |
231 | - result = wlp_enroll_neighbor(wlp, neighbor, wss, | |
232 | - wssid); | |
215 | + result = wlp_enroll_neighbor(wlp, neighbor, wss, wssid); | |
233 | 216 | break; |
234 | 217 | } |
235 | 218 | } |
... | ... | @@ -237,8 +220,6 @@ |
237 | 220 | dev_err(dev, "WLP: Cannot find neighbor %02x:%02x. \n", |
238 | 221 | dest->data[1], dest->data[0]); |
239 | 222 | mutex_unlock(&wlp->nbmutex); |
240 | - d_fnend(5, dev, "wss %p, wssid %s, registrar %02x:%02x, result %d \n", | |
241 | - wss, buf, dest->data[1], dest->data[0], result); | |
242 | 223 | return result; |
243 | 224 | } |
244 | 225 | |
245 | 226 | |
... | ... | @@ -260,16 +241,11 @@ |
260 | 241 | char buf[WLP_WSS_UUID_STRSIZE]; |
261 | 242 | int result = -ENXIO; |
262 | 243 | |
263 | - wlp_wss_uuid_print(buf, sizeof(buf), wssid); | |
264 | - d_fnstart(5, dev, "wss %p, wssid %s \n", wss, buf); | |
244 | + | |
265 | 245 | mutex_lock(&wlp->nbmutex); |
266 | 246 | list_for_each_entry(neighbor, &wlp->neighbors, node) { |
267 | 247 | list_for_each_entry(wssid_e, &neighbor->wssid, node) { |
268 | 248 | if (!memcmp(wssid, &wssid_e->wssid, sizeof(*wssid))) { |
269 | - d_printf(5, dev, "Found WSSID %s in neighbor " | |
270 | - "%02x:%02x cache. \n", buf, | |
271 | - neighbor->uwb_dev->dev_addr.data[1], | |
272 | - neighbor->uwb_dev->dev_addr.data[0]); | |
273 | 249 | result = wlp_enroll_neighbor(wlp, neighbor, |
274 | 250 | wss, wssid); |
275 | 251 | if (result == 0) /* enrollment success */ |
276 | 252 | |
277 | 253 | |
... | ... | @@ -279,10 +255,11 @@ |
279 | 255 | } |
280 | 256 | } |
281 | 257 | out: |
282 | - if (result == -ENXIO) | |
258 | + if (result == -ENXIO) { | |
259 | + wlp_wss_uuid_print(buf, sizeof(buf), wssid); | |
283 | 260 | dev_err(dev, "WLP: Cannot find WSSID %s in cache. \n", buf); |
261 | + } | |
284 | 262 | mutex_unlock(&wlp->nbmutex); |
285 | - d_fnend(5, dev, "wss %p, wssid %s, result %d \n", wss, buf, result); | |
286 | 263 | return result; |
287 | 264 | } |
288 | 265 | |
289 | 266 | |
290 | 267 | |
291 | 268 | |
292 | 269 | |
... | ... | @@ -307,27 +284,22 @@ |
307 | 284 | struct uwb_dev_addr bcast = {.data = {0xff, 0xff} }; |
308 | 285 | |
309 | 286 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
287 | + | |
310 | 288 | if (wss->state != WLP_WSS_STATE_NONE) { |
311 | 289 | dev_err(dev, "WLP: Already enrolled in WSS %s.\n", buf); |
312 | 290 | result = -EEXIST; |
313 | 291 | goto error; |
314 | 292 | } |
315 | - if (!memcmp(&bcast, devaddr, sizeof(bcast))) { | |
316 | - d_printf(5, dev, "Request to enroll in discovered WSS " | |
317 | - "with WSSID %s \n", buf); | |
293 | + if (!memcmp(&bcast, devaddr, sizeof(bcast))) | |
318 | 294 | result = wlp_wss_enroll_discovered(wss, wssid); |
319 | - } else { | |
320 | - d_printf(5, dev, "Request to enroll in WSSID %s with " | |
321 | - "registrar %02x:%02x\n", buf, devaddr->data[1], | |
322 | - devaddr->data[0]); | |
295 | + else | |
323 | 296 | result = wlp_wss_enroll_target(wss, wssid, devaddr); |
324 | - } | |
325 | 297 | if (result < 0) { |
326 | 298 | dev_err(dev, "WLP: Unable to enroll into WSS %s, result %d \n", |
327 | 299 | buf, result); |
328 | 300 | goto error; |
329 | 301 | } |
330 | - d_printf(2, dev, "Successfully enrolled into WSS %s \n", buf); | |
302 | + dev_dbg(dev, "Successfully enrolled into WSS %s \n", buf); | |
331 | 303 | result = wlp_wss_sysfs_add(wss, buf); |
332 | 304 | if (result < 0) { |
333 | 305 | dev_err(dev, "WLP: Unable to set up sysfs for WSS kobject.\n"); |
... | ... | @@ -363,7 +335,6 @@ |
363 | 335 | u8 hash; /* only include one hash */ |
364 | 336 | } ie_data; |
365 | 337 | |
366 | - d_fnstart(5, dev, "Activating WSS %p. \n", wss); | |
367 | 338 | BUG_ON(wss->state != WLP_WSS_STATE_ENROLLED); |
368 | 339 | wss->hash = wlp_wss_comp_wssid_hash(&wss->wssid); |
369 | 340 | wss->tag = wss->hash; |
... | ... | @@ -382,7 +353,6 @@ |
382 | 353 | wss->state = WLP_WSS_STATE_ACTIVE; |
383 | 354 | result = 0; |
384 | 355 | error_wlp_ie: |
385 | - d_fnend(5, dev, "Activating WSS %p, result = %d \n", wss, result); | |
386 | 356 | return result; |
387 | 357 | } |
388 | 358 | |
... | ... | @@ -405,7 +375,6 @@ |
405 | 375 | int result = 0; |
406 | 376 | char buf[WLP_WSS_UUID_STRSIZE]; |
407 | 377 | |
408 | - d_fnstart(5, dev, "Enrollment and activation requested. \n"); | |
409 | 378 | mutex_lock(&wss->mutex); |
410 | 379 | result = wlp_wss_enroll(wss, wssid, devaddr); |
411 | 380 | if (result < 0) { |
... | ... | @@ -424,7 +393,6 @@ |
424 | 393 | error_activate: |
425 | 394 | error_enroll: |
426 | 395 | mutex_unlock(&wss->mutex); |
427 | - d_fnend(5, dev, "Completed. result = %d \n", result); | |
428 | 396 | return result; |
429 | 397 | } |
430 | 398 | |
431 | 399 | |
... | ... | @@ -447,11 +415,9 @@ |
447 | 415 | struct device *dev = &wlp->rc->uwb_dev.dev; |
448 | 416 | int result = 0; |
449 | 417 | char buf[WLP_WSS_UUID_STRSIZE]; |
450 | - d_fnstart(5, dev, "Request to create new WSS.\n"); | |
418 | + | |
451 | 419 | result = wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
452 | - d_printf(5, dev, "Request to create WSS: WSSID=%s, name=%s, " | |
453 | - "sec_status=%u, accepting enrollment=%u \n", | |
454 | - buf, name, sec_status, accept); | |
420 | + | |
455 | 421 | if (!mutex_trylock(&wss->mutex)) { |
456 | 422 | dev_err(dev, "WLP: WLP association session in progress.\n"); |
457 | 423 | return -EBUSY; |
... | ... | @@ -498,7 +464,6 @@ |
498 | 464 | result = 0; |
499 | 465 | out: |
500 | 466 | mutex_unlock(&wss->mutex); |
501 | - d_fnend(5, dev, "Completed. result = %d \n", result); | |
502 | 467 | return result; |
503 | 468 | } |
504 | 469 | |
505 | 470 | |
... | ... | @@ -520,16 +485,12 @@ |
520 | 485 | { |
521 | 486 | int result = 0; |
522 | 487 | struct device *dev = &wlp->rc->uwb_dev.dev; |
523 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
524 | 488 | DECLARE_COMPLETION_ONSTACK(completion); |
525 | 489 | struct wlp_session session; |
526 | 490 | struct sk_buff *skb; |
527 | 491 | struct wlp_frame_assoc *resp; |
528 | 492 | struct wlp_uuid wssid; |
529 | 493 | |
530 | - wlp_wss_uuid_print(buf, sizeof(buf), &wss->wssid); | |
531 | - d_fnstart(5, dev, "wlp %p, wss %p (wssid %s), neighbor %02x:%02x \n", | |
532 | - wlp, wss, buf, dev_addr->data[1], dev_addr->data[0]); | |
533 | 494 | mutex_lock(&wlp->mutex); |
534 | 495 | /* Send C1 association frame */ |
535 | 496 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C1); |
... | ... | @@ -565,8 +526,6 @@ |
565 | 526 | /* Parse message in session->data: it will be either C2 or F0 */ |
566 | 527 | skb = session.data; |
567 | 528 | resp = (void *) skb->data; |
568 | - d_printf(5, dev, "Received response to C1 frame. \n"); | |
569 | - d_dump(5, dev, skb->data, skb->len > 72 ? 72 : skb->len); | |
570 | 529 | if (resp->type == WLP_ASSOC_F0) { |
571 | 530 | result = wlp_parse_f0(wlp, skb); |
572 | 531 | if (result < 0) |
573 | 532 | |
... | ... | @@ -584,11 +543,9 @@ |
584 | 543 | result = 0; |
585 | 544 | goto error_resp_parse; |
586 | 545 | } |
587 | - if (!memcmp(&wssid, &wss->wssid, sizeof(wssid))) { | |
588 | - d_printf(5, dev, "WSSID in C2 frame matches local " | |
589 | - "active WSS.\n"); | |
546 | + if (!memcmp(&wssid, &wss->wssid, sizeof(wssid))) | |
590 | 547 | result = 1; |
591 | - } else { | |
548 | + else { | |
592 | 549 | dev_err(dev, "WLP: Received a C2 frame without matching " |
593 | 550 | "WSSID.\n"); |
594 | 551 | result = 0; |
... | ... | @@ -598,8 +555,6 @@ |
598 | 555 | out: |
599 | 556 | wlp->session = NULL; |
600 | 557 | mutex_unlock(&wlp->mutex); |
601 | - d_fnend(5, dev, "wlp %p, wss %p (wssid %s), neighbor %02x:%02x \n", | |
602 | - wlp, wss, buf, dev_addr->data[1], dev_addr->data[0]); | |
603 | 558 | return result; |
604 | 559 | } |
605 | 560 | |
606 | 561 | |
... | ... | @@ -620,16 +575,8 @@ |
620 | 575 | { |
621 | 576 | struct device *dev = &wlp->rc->uwb_dev.dev; |
622 | 577 | int result = 0; |
623 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
624 | - wlp_wss_uuid_print(buf, sizeof(buf), wssid); | |
625 | - d_fnstart(5, dev, "wlp %p, wss %p, wssid %s, tag %u, virtual " | |
626 | - "%02x:%02x:%02x:%02x:%02x:%02x \n", wlp, wss, buf, *tag, | |
627 | - virt_addr->data[0], virt_addr->data[1], virt_addr->data[2], | |
628 | - virt_addr->data[3], virt_addr->data[4], virt_addr->data[5]); | |
629 | 578 | |
630 | 579 | if (!memcmp(wssid, &wss->wssid, sizeof(*wssid))) { |
631 | - d_printf(5, dev, "WSSID from neighbor frame matches local " | |
632 | - "active WSS.\n"); | |
633 | 580 | /* Update EDA cache */ |
634 | 581 | result = wlp_eda_update_node(&wlp->eda, dev_addr, wss, |
635 | 582 | (void *) virt_addr->data, *tag, |
636 | 583 | |
... | ... | @@ -638,18 +585,9 @@ |
638 | 585 | dev_err(dev, "WLP: Unable to update EDA cache " |
639 | 586 | "with new connected neighbor information.\n"); |
640 | 587 | } else { |
641 | - dev_err(dev, "WLP: Neighbor does not have matching " | |
642 | - "WSSID.\n"); | |
588 | + dev_err(dev, "WLP: Neighbor does not have matching WSSID.\n"); | |
643 | 589 | result = -EINVAL; |
644 | 590 | } |
645 | - | |
646 | - d_fnend(5, dev, "wlp %p, wss %p, wssid %s, tag %u, virtual " | |
647 | - "%02x:%02x:%02x:%02x:%02x:%02x, result = %d \n", | |
648 | - wlp, wss, buf, *tag, | |
649 | - virt_addr->data[0], virt_addr->data[1], virt_addr->data[2], | |
650 | - virt_addr->data[3], virt_addr->data[4], virt_addr->data[5], | |
651 | - result); | |
652 | - | |
653 | 591 | return result; |
654 | 592 | } |
655 | 593 | |
... | ... | @@ -665,7 +603,6 @@ |
665 | 603 | { |
666 | 604 | int result; |
667 | 605 | struct device *dev = &wlp->rc->uwb_dev.dev; |
668 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
669 | 606 | struct wlp_uuid wssid; |
670 | 607 | u8 tag; |
671 | 608 | struct uwb_mac_addr virt_addr; |
... | ... | @@ -674,9 +611,6 @@ |
674 | 611 | struct wlp_frame_assoc *resp; |
675 | 612 | struct sk_buff *skb; |
676 | 613 | |
677 | - wlp_wss_uuid_print(buf, sizeof(buf), &wss->wssid); | |
678 | - d_fnstart(5, dev, "wlp %p, wss %p (wssid %s), neighbor %02x:%02x \n", | |
679 | - wlp, wss, buf, dev_addr->data[1], dev_addr->data[0]); | |
680 | 614 | mutex_lock(&wlp->mutex); |
681 | 615 | /* Send C3 association frame */ |
682 | 616 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C3); |
... | ... | @@ -711,8 +645,6 @@ |
711 | 645 | /* Parse message in session->data: it will be either C4 or F0 */ |
712 | 646 | skb = session.data; |
713 | 647 | resp = (void *) skb->data; |
714 | - d_printf(5, dev, "Received response to C3 frame. \n"); | |
715 | - d_dump(5, dev, skb->data, skb->len > 72 ? 72 : skb->len); | |
716 | 648 | if (resp->type == WLP_ASSOC_F0) { |
717 | 649 | result = wlp_parse_f0(wlp, skb); |
718 | 650 | if (result < 0) |
... | ... | @@ -744,8 +676,6 @@ |
744 | 676 | WLP_WSS_CONNECT_FAILED); |
745 | 677 | wlp->session = NULL; |
746 | 678 | mutex_unlock(&wlp->mutex); |
747 | - d_fnend(5, dev, "wlp %p, wss %p (wssid %s), neighbor %02x:%02x \n", | |
748 | - wlp, wss, buf, dev_addr->data[1], dev_addr->data[0]); | |
749 | 679 | return result; |
750 | 680 | } |
751 | 681 | |
752 | 682 | |
... | ... | @@ -780,12 +710,8 @@ |
780 | 710 | struct wlp_wss *wss = &wlp->wss; |
781 | 711 | int result; |
782 | 712 | struct device *dev = &wlp->rc->uwb_dev.dev; |
783 | - char buf[WLP_WSS_UUID_STRSIZE]; | |
784 | 713 | |
785 | 714 | mutex_lock(&wss->mutex); |
786 | - wlp_wss_uuid_print(buf, sizeof(buf), &wss->wssid); | |
787 | - d_fnstart(5, dev, "wlp %p, wss %p (wssid %s), neighbor %02x:%02x \n", | |
788 | - wlp, wss, buf, dev_addr->data[1], dev_addr->data[0]); | |
789 | 715 | if (wss->state < WLP_WSS_STATE_ACTIVE) { |
790 | 716 | if (printk_ratelimit()) |
791 | 717 | dev_err(dev, "WLP: Attempting to connect with " |
... | ... | @@ -836,7 +762,6 @@ |
836 | 762 | BUG_ON(wlp->start_queue == NULL); |
837 | 763 | wlp->start_queue(wlp); |
838 | 764 | mutex_unlock(&wss->mutex); |
839 | - d_fnend(5, dev, "wlp %p, wss %p (wssid %s)\n", wlp, wss, buf); | |
840 | 765 | } |
841 | 766 | |
842 | 767 | /** |
... | ... | @@ -855,7 +780,6 @@ |
855 | 780 | struct sk_buff *skb = _skb; |
856 | 781 | struct wlp_frame_std_abbrv_hdr *std_hdr; |
857 | 782 | |
858 | - d_fnstart(6, dev, "wlp %p \n", wlp); | |
859 | 783 | if (eda_entry->state == WLP_WSS_CONNECTED) { |
860 | 784 | /* Add WLP header */ |
861 | 785 | BUG_ON(skb_headroom(skb) < sizeof(*std_hdr)); |
... | ... | @@ -873,7 +797,6 @@ |
873 | 797 | dev_addr->data[0]); |
874 | 798 | result = -EINVAL; |
875 | 799 | } |
876 | - d_fnend(6, dev, "wlp %p \n", wlp); | |
877 | 800 | return result; |
878 | 801 | } |
879 | 802 | |
880 | 803 | |
... | ... | @@ -893,16 +816,9 @@ |
893 | 816 | { |
894 | 817 | int result = 0; |
895 | 818 | struct device *dev = &wlp->rc->uwb_dev.dev; |
896 | - struct uwb_dev_addr *dev_addr = &eda_entry->dev_addr; | |
897 | - unsigned char *eth_addr = eda_entry->eth_addr; | |
898 | 819 | struct sk_buff *skb = _skb; |
899 | 820 | struct wlp_assoc_conn_ctx *conn_ctx; |
900 | 821 | |
901 | - d_fnstart(5, dev, "wlp %p\n", wlp); | |
902 | - d_printf(5, dev, "To neighbor %02x:%02x with eth " | |
903 | - "%02x:%02x:%02x:%02x:%02x:%02x\n", dev_addr->data[1], | |
904 | - dev_addr->data[0], eth_addr[0], eth_addr[1], eth_addr[2], | |
905 | - eth_addr[3], eth_addr[4], eth_addr[5]); | |
906 | 822 | if (eda_entry->state == WLP_WSS_UNCONNECTED) { |
907 | 823 | /* We don't want any more packets while we set up connection */ |
908 | 824 | BUG_ON(wlp->stop_queue == NULL); |
909 | 825 | |
910 | 826 | |
... | ... | @@ -929,12 +845,9 @@ |
929 | 845 | "previously. Not retrying. \n"); |
930 | 846 | result = -ENONET; |
931 | 847 | goto out; |
932 | - } else { /* eda_entry->state == WLP_WSS_CONNECTED */ | |
933 | - d_printf(5, dev, "Neighbor is connected, preparing frame.\n"); | |
848 | + } else /* eda_entry->state == WLP_WSS_CONNECTED */ | |
934 | 849 | result = wlp_wss_prep_hdr(wlp, eda_entry, skb); |
935 | - } | |
936 | 850 | out: |
937 | - d_fnend(5, dev, "wlp %p, result = %d \n", wlp, result); | |
938 | 851 | return result; |
939 | 852 | } |
940 | 853 | |
... | ... | @@ -957,8 +870,6 @@ |
957 | 870 | struct sk_buff *copy; |
958 | 871 | struct uwb_dev_addr *dev_addr = &eda_entry->dev_addr; |
959 | 872 | |
960 | - d_fnstart(5, dev, "to neighbor %02x:%02x, skb (%p) \n", | |
961 | - dev_addr->data[1], dev_addr->data[0], skb); | |
962 | 873 | copy = skb_copy(skb, GFP_ATOMIC); |
963 | 874 | if (copy == NULL) { |
964 | 875 | if (printk_ratelimit()) |
... | ... | @@ -988,8 +899,6 @@ |
988 | 899 | dev_kfree_skb_irq(copy);/*we need to free if tx fails */ |
989 | 900 | } |
990 | 901 | out: |
991 | - d_fnend(5, dev, "to neighbor %02x:%02x \n", dev_addr->data[1], | |
992 | - dev_addr->data[0]); | |
993 | 902 | return result; |
994 | 903 | } |
995 | 904 | |
... | ... | @@ -1005,7 +914,7 @@ |
1005 | 914 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
1006 | 915 | struct device *dev = &wlp->rc->uwb_dev.dev; |
1007 | 916 | int result = 0; |
1008 | - d_fnstart(5, dev, "wss (%p) \n", wss); | |
917 | + | |
1009 | 918 | mutex_lock(&wss->mutex); |
1010 | 919 | wss->kobj.parent = &net_dev->dev.kobj; |
1011 | 920 | if (!is_valid_ether_addr(net_dev->dev_addr)) { |
... | ... | @@ -1018,7 +927,6 @@ |
1018 | 927 | sizeof(wss->virtual_addr.data)); |
1019 | 928 | out: |
1020 | 929 | mutex_unlock(&wss->mutex); |
1021 | - d_fnend(5, dev, "wss (%p) \n", wss); | |
1022 | 930 | return result; |
1023 | 931 | } |
1024 | 932 | EXPORT_SYMBOL_GPL(wlp_wss_setup); |
... | ... | @@ -1035,8 +943,7 @@ |
1035 | 943 | void wlp_wss_remove(struct wlp_wss *wss) |
1036 | 944 | { |
1037 | 945 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
1038 | - struct device *dev = &wlp->rc->uwb_dev.dev; | |
1039 | - d_fnstart(5, dev, "wss (%p) \n", wss); | |
946 | + | |
1040 | 947 | mutex_lock(&wss->mutex); |
1041 | 948 | if (wss->state == WLP_WSS_STATE_ACTIVE) |
1042 | 949 | uwb_rc_ie_rm(wlp->rc, UWB_IE_WLP); |
... | ... | @@ -1050,7 +957,6 @@ |
1050 | 957 | wlp_eda_release(&wlp->eda); |
1051 | 958 | wlp_eda_init(&wlp->eda); |
1052 | 959 | mutex_unlock(&wss->mutex); |
1053 | - d_fnend(5, dev, "wss (%p) \n", wss); | |
1054 | 960 | } |
1055 | 961 | EXPORT_SYMBOL_GPL(wlp_wss_remove); |