diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-12-22 13:22:50 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-12-22 13:22:50 -0500 |
commit | bce83697c5fe84a7a5d38c96fbbe43b4bc028c3e (patch) | |
tree | b8e920af66f5b4de509e95a7295cedbe42878dd6 /drivers/uwb/i1480 | |
parent | 02f11ee181baa562df23e105ba930902f0d0b1bf (diff) |
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>
Diffstat (limited to 'drivers/uwb/i1480')
-rw-r--r-- | drivers/uwb/i1480/dfu/dfu.c | 10 | ||||
-rw-r--r-- | drivers/uwb/i1480/dfu/mac.c | 18 | ||||
-rw-r--r-- | drivers/uwb/i1480/dfu/usb.c | 26 | ||||
-rw-r--r-- | drivers/uwb/i1480/i1480u-wlp/rx.c | 25 | ||||
-rw-r--r-- | drivers/uwb/i1480/i1480u-wlp/tx.c | 66 |
5 files changed, 17 insertions, 128 deletions
diff --git a/drivers/uwb/i1480/dfu/dfu.c b/drivers/uwb/i1480/dfu/dfu.c index 9097b3b30385..da7b1d08003c 100644 --- a/drivers/uwb/i1480/dfu/dfu.c +++ b/drivers/uwb/i1480/dfu/dfu.c | |||
@@ -34,10 +34,7 @@ | |||
34 | #include <linux/uwb.h> | 34 | #include <linux/uwb.h> |
35 | #include <linux/random.h> | 35 | #include <linux/random.h> |
36 | 36 | ||
37 | #define D_LOCAL 0 | 37 | /* |
38 | #include <linux/uwb/debug.h> | ||
39 | |||
40 | /** | ||
41 | * i1480_rceb_check - Check RCEB for expected field values | 38 | * i1480_rceb_check - Check RCEB for expected field values |
42 | * @i1480: pointer to device for which RCEB is being checked | 39 | * @i1480: pointer to device for which RCEB is being checked |
43 | * @rceb: RCEB being checked | 40 | * @rceb: RCEB being checked |
@@ -83,7 +80,7 @@ int i1480_rceb_check(const struct i1480 *i1480, const struct uwb_rceb *rceb, | |||
83 | EXPORT_SYMBOL_GPL(i1480_rceb_check); | 80 | EXPORT_SYMBOL_GPL(i1480_rceb_check); |
84 | 81 | ||
85 | 82 | ||
86 | /** | 83 | /* |
87 | * Execute a Radio Control Command | 84 | * Execute a Radio Control Command |
88 | * | 85 | * |
89 | * Command data has to be in i1480->cmd_buf. | 86 | * Command data has to be in i1480->cmd_buf. |
@@ -101,7 +98,6 @@ ssize_t i1480_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size, | |||
101 | u8 expected_type = reply->bEventType; | 98 | u8 expected_type = reply->bEventType; |
102 | u8 context; | 99 | u8 context; |
103 | 100 | ||
104 | d_fnstart(3, i1480->dev, "(%p, %s, %zu)\n", i1480, cmd_name, cmd_size); | ||
105 | init_completion(&i1480->evt_complete); | 101 | init_completion(&i1480->evt_complete); |
106 | i1480->evt_result = -EINPROGRESS; | 102 | i1480->evt_result = -EINPROGRESS; |
107 | do { | 103 | do { |
@@ -150,8 +146,6 @@ ssize_t i1480_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size, | |||
150 | result = i1480_rceb_check(i1480, i1480->evt_buf, cmd_name, context, | 146 | result = i1480_rceb_check(i1480, i1480->evt_buf, cmd_name, context, |
151 | expected_type, expected_event); | 147 | expected_type, expected_event); |
152 | error: | 148 | error: |
153 | d_fnend(3, i1480->dev, "(%p, %s, %zu) = %zd\n", | ||
154 | i1480, cmd_name, cmd_size, result); | ||
155 | return result; | 149 | return result; |
156 | } | 150 | } |
157 | EXPORT_SYMBOL_GPL(i1480_cmd); | 151 | EXPORT_SYMBOL_GPL(i1480_cmd); |
diff --git a/drivers/uwb/i1480/dfu/mac.c b/drivers/uwb/i1480/dfu/mac.c index 2e4d8f07c165..694d0daf88ab 100644 --- a/drivers/uwb/i1480/dfu/mac.c +++ b/drivers/uwb/i1480/dfu/mac.c | |||
@@ -31,9 +31,6 @@ | |||
31 | #include <linux/uwb.h> | 31 | #include <linux/uwb.h> |
32 | #include "i1480-dfu.h" | 32 | #include "i1480-dfu.h" |
33 | 33 | ||
34 | #define D_LOCAL 0 | ||
35 | #include <linux/uwb/debug.h> | ||
36 | |||
37 | /* | 34 | /* |
38 | * Descriptor for a continuous segment of MAC fw data | 35 | * Descriptor for a continuous segment of MAC fw data |
39 | */ | 36 | */ |
@@ -184,10 +181,6 @@ ssize_t i1480_fw_cmp(struct i1480 *i1480, struct fw_hdr *hdr) | |||
184 | } | 181 | } |
185 | if (memcmp(i1480->cmd_buf, bin + src_itr, result)) { | 182 | if (memcmp(i1480->cmd_buf, bin + src_itr, result)) { |
186 | u8 *buf = i1480->cmd_buf; | 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 | for (cnt = 0; cnt < result; cnt++) | 184 | for (cnt = 0; cnt < result; cnt++) |
192 | if (bin[src_itr + cnt] != buf[cnt]) { | 185 | if (bin[src_itr + cnt] != buf[cnt]) { |
193 | dev_err(i1480->dev, "byte failed at " | 186 | dev_err(i1480->dev, "byte failed at " |
@@ -224,7 +217,6 @@ int mac_fw_hdrs_push(struct i1480 *i1480, struct fw_hdr *hdr, | |||
224 | struct fw_hdr *hdr_itr; | 217 | struct fw_hdr *hdr_itr; |
225 | int verif_retry_count; | 218 | int verif_retry_count; |
226 | 219 | ||
227 | d_fnstart(3, dev, "(%p, %p)\n", i1480, hdr); | ||
228 | /* Now, header by header, push them to the hw */ | 220 | /* Now, header by header, push them to the hw */ |
229 | for (hdr_itr = hdr; hdr_itr != NULL; hdr_itr = hdr_itr->next) { | 221 | for (hdr_itr = hdr; hdr_itr != NULL; hdr_itr = hdr_itr->next) { |
230 | verif_retry_count = 0; | 222 | verif_retry_count = 0; |
@@ -264,7 +256,6 @@ retry: | |||
264 | break; | 256 | break; |
265 | } | 257 | } |
266 | } | 258 | } |
267 | d_fnend(3, dev, "(%zd)\n", result); | ||
268 | return result; | 259 | return result; |
269 | } | 260 | } |
270 | 261 | ||
@@ -337,11 +328,9 @@ int __mac_fw_upload(struct i1480 *i1480, const char *fw_name, | |||
337 | const struct firmware *fw; | 328 | const struct firmware *fw; |
338 | struct fw_hdr *fw_hdrs; | 329 | struct fw_hdr *fw_hdrs; |
339 | 330 | ||
340 | d_fnstart(3, i1480->dev, "(%p, %s, %s)\n", i1480, fw_name, fw_tag); | ||
341 | result = request_firmware(&fw, fw_name, i1480->dev); | 331 | result = request_firmware(&fw, fw_name, i1480->dev); |
342 | if (result < 0) /* Up to caller to complain on -ENOENT */ | 332 | if (result < 0) /* Up to caller to complain on -ENOENT */ |
343 | goto out; | 333 | goto out; |
344 | d_printf(3, i1480->dev, "%s fw '%s': uploading\n", fw_tag, fw_name); | ||
345 | result = fw_hdrs_load(i1480, &fw_hdrs, fw->data, fw->size); | 334 | result = fw_hdrs_load(i1480, &fw_hdrs, fw->data, fw->size); |
346 | if (result < 0) { | 335 | if (result < 0) { |
347 | dev_err(i1480->dev, "%s fw '%s': failed to parse firmware " | 336 | dev_err(i1480->dev, "%s fw '%s': failed to parse firmware " |
@@ -363,8 +352,6 @@ out_hdrs_release: | |||
363 | out_release: | 352 | out_release: |
364 | release_firmware(fw); | 353 | release_firmware(fw); |
365 | out: | 354 | out: |
366 | d_fnend(3, i1480->dev, "(%p, %s, %s) = %d\n", i1480, fw_name, fw_tag, | ||
367 | result); | ||
368 | return result; | 355 | return result; |
369 | } | 356 | } |
370 | 357 | ||
@@ -433,7 +420,6 @@ int i1480_fw_is_running_q(struct i1480 *i1480) | |||
433 | int result; | 420 | int result; |
434 | u32 *val = (u32 *) i1480->cmd_buf; | 421 | u32 *val = (u32 *) i1480->cmd_buf; |
435 | 422 | ||
436 | d_fnstart(3, i1480->dev, "(i1480 %p)\n", i1480); | ||
437 | for (cnt = 0; cnt < 10; cnt++) { | 423 | for (cnt = 0; cnt < 10; cnt++) { |
438 | msleep(100); | 424 | msleep(100); |
439 | result = i1480->read(i1480, 0x80080000, 4); | 425 | result = i1480->read(i1480, 0x80080000, 4); |
@@ -447,7 +433,6 @@ int i1480_fw_is_running_q(struct i1480 *i1480) | |||
447 | dev_err(i1480->dev, "Timed out waiting for fw to start\n"); | 433 | dev_err(i1480->dev, "Timed out waiting for fw to start\n"); |
448 | result = -ETIMEDOUT; | 434 | result = -ETIMEDOUT; |
449 | out: | 435 | out: |
450 | d_fnend(3, i1480->dev, "(i1480 %p) = %d\n", i1480, result); | ||
451 | return result; | 436 | return result; |
452 | 437 | ||
453 | } | 438 | } |
@@ -467,7 +452,6 @@ int i1480_mac_fw_upload(struct i1480 *i1480) | |||
467 | int result = 0, deprecated_name = 0; | 452 | int result = 0, deprecated_name = 0; |
468 | struct i1480_rceb *rcebe = (void *) i1480->evt_buf; | 453 | struct i1480_rceb *rcebe = (void *) i1480->evt_buf; |
469 | 454 | ||
470 | d_fnstart(3, i1480->dev, "(%p)\n", i1480); | ||
471 | result = __mac_fw_upload(i1480, i1480->mac_fw_name, "MAC"); | 455 | result = __mac_fw_upload(i1480, i1480->mac_fw_name, "MAC"); |
472 | if (result == -ENOENT) { | 456 | if (result == -ENOENT) { |
473 | result = __mac_fw_upload(i1480, i1480->mac_fw_name_deprecate, | 457 | result = __mac_fw_upload(i1480, i1480->mac_fw_name_deprecate, |
@@ -501,7 +485,6 @@ int i1480_mac_fw_upload(struct i1480 *i1480) | |||
501 | dev_err(i1480->dev, "MAC fw '%s': initialization event returns " | 485 | dev_err(i1480->dev, "MAC fw '%s': initialization event returns " |
502 | "wrong size (%zu bytes vs %zu needed)\n", | 486 | "wrong size (%zu bytes vs %zu needed)\n", |
503 | i1480->mac_fw_name, i1480->evt_result, sizeof(*rcebe)); | 487 | i1480->mac_fw_name, i1480->evt_result, sizeof(*rcebe)); |
504 | dump_bytes(i1480->dev, rcebe, min(i1480->evt_result, (ssize_t)32)); | ||
505 | goto error_size; | 488 | goto error_size; |
506 | } | 489 | } |
507 | result = -EIO; | 490 | result = -EIO; |
@@ -522,6 +505,5 @@ error_fw_not_running: | |||
522 | error_init_timeout: | 505 | error_init_timeout: |
523 | error_size: | 506 | error_size: |
524 | error_setup: | 507 | error_setup: |
525 | d_fnend(3, i1480->dev, "(i1480 %p) = %d\n", i1480, result); | ||
526 | return result; | 508 | return result; |
527 | } | 509 | } |
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c index b7ea525fc06a..686795e97195 100644 --- a/drivers/uwb/i1480/dfu/usb.c +++ b/drivers/uwb/i1480/dfu/usb.c | |||
@@ -43,10 +43,6 @@ | |||
43 | #include <linux/usb/wusb-wa.h> | 43 | #include <linux/usb/wusb-wa.h> |
44 | #include "i1480-dfu.h" | 44 | #include "i1480-dfu.h" |
45 | 45 | ||
46 | #define D_LOCAL 0 | ||
47 | #include <linux/uwb/debug.h> | ||
48 | |||
49 | |||
50 | struct i1480_usb { | 46 | struct i1480_usb { |
51 | struct i1480 i1480; | 47 | struct i1480 i1480; |
52 | struct usb_device *usb_dev; | 48 | struct usb_device *usb_dev; |
@@ -117,8 +113,6 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address, | |||
117 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); | 113 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); |
118 | size_t buffer_size, itr = 0; | 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 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ | 116 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ |
123 | while (size > 0) { | 117 | while (size > 0) { |
124 | buffer_size = size < i1480->buf_size ? size : i1480->buf_size; | 118 | buffer_size = size < i1480->buf_size ? size : i1480->buf_size; |
@@ -131,16 +125,10 @@ int i1480_usb_write(struct i1480 *i1480, u32 memory_address, | |||
131 | i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */); | 125 | i1480->cmd_buf, buffer_size, 100 /* FIXME: arbitrary */); |
132 | if (result < 0) | 126 | if (result < 0) |
133 | break; | 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 | itr += result; | 128 | itr += result; |
139 | memory_address += result; | 129 | memory_address += result; |
140 | size -= result; | 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 | return result; | 132 | return result; |
145 | } | 133 | } |
146 | 134 | ||
@@ -165,8 +153,6 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size) | |||
165 | size_t itr, read_size = i1480->buf_size; | 153 | size_t itr, read_size = i1480->buf_size; |
166 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); | 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 | BUG_ON(size > i1480->buf_size); | 156 | BUG_ON(size > i1480->buf_size); |
171 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ | 157 | BUG_ON(size & 0x3); /* Needs to be a multiple of 4 */ |
172 | BUG_ON(read_size > 512); | 158 | BUG_ON(read_size > 512); |
@@ -200,10 +186,6 @@ int i1480_usb_read(struct i1480 *i1480, u32 addr, size_t size) | |||
200 | } | 186 | } |
201 | result = bytes; | 187 | result = bytes; |
202 | out: | 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 | return result; | 189 | return result; |
208 | } | 190 | } |
209 | 191 | ||
@@ -259,7 +241,6 @@ int i1480_usb_wait_init_done(struct i1480 *i1480) | |||
259 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); | 241 | struct i1480_usb *i1480_usb = container_of(i1480, struct i1480_usb, i1480); |
260 | struct usb_endpoint_descriptor *epd; | 242 | struct usb_endpoint_descriptor *epd; |
261 | 243 | ||
262 | d_fnstart(3, dev, "(%p)\n", i1480); | ||
263 | init_completion(&i1480->evt_complete); | 244 | init_completion(&i1480->evt_complete); |
264 | i1480->evt_result = -EINPROGRESS; | 245 | i1480->evt_result = -EINPROGRESS; |
265 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; | 246 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; |
@@ -281,14 +262,12 @@ int i1480_usb_wait_init_done(struct i1480 *i1480) | |||
281 | goto error_wait; | 262 | goto error_wait; |
282 | } | 263 | } |
283 | usb_kill_urb(i1480_usb->neep_urb); | 264 | usb_kill_urb(i1480_usb->neep_urb); |
284 | d_fnend(3, dev, "(%p) = 0\n", i1480); | ||
285 | return 0; | 265 | return 0; |
286 | 266 | ||
287 | error_wait: | 267 | error_wait: |
288 | usb_kill_urb(i1480_usb->neep_urb); | 268 | usb_kill_urb(i1480_usb->neep_urb); |
289 | error_submit: | 269 | error_submit: |
290 | i1480->evt_result = result; | 270 | i1480->evt_result = result; |
291 | d_fnend(3, dev, "(%p) = %d\n", i1480, result); | ||
292 | return result; | 271 | return result; |
293 | } | 272 | } |
294 | 273 | ||
@@ -319,7 +298,6 @@ int i1480_usb_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size) | |||
319 | struct uwb_rccb *cmd = i1480->cmd_buf; | 298 | struct uwb_rccb *cmd = i1480->cmd_buf; |
320 | u8 iface_no; | 299 | u8 iface_no; |
321 | 300 | ||
322 | d_fnstart(3, dev, "(%p, %s, %zu)\n", i1480, cmd_name, cmd_size); | ||
323 | /* Post a read on the notification & event endpoint */ | 301 | /* Post a read on the notification & event endpoint */ |
324 | iface_no = i1480_usb->usb_iface->cur_altsetting->desc.bInterfaceNumber; | 302 | iface_no = i1480_usb->usb_iface->cur_altsetting->desc.bInterfaceNumber; |
325 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; | 303 | epd = &i1480_usb->usb_iface->cur_altsetting->endpoint[0].desc; |
@@ -347,15 +325,11 @@ int i1480_usb_cmd(struct i1480 *i1480, const char *cmd_name, size_t cmd_size) | |||
347 | cmd_name, result); | 325 | cmd_name, result); |
348 | goto error_submit_ep0; | 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 | return result; | 328 | return result; |
353 | 329 | ||
354 | error_submit_ep0: | 330 | error_submit_ep0: |
355 | usb_kill_urb(i1480_usb->neep_urb); | 331 | usb_kill_urb(i1480_usb->neep_urb); |
356 | error_submit_ep1: | 332 | error_submit_ep1: |
357 | d_fnend(3, dev, "(%p, %s, %zu) = %d\n", | ||
358 | i1480, cmd_name, cmd_size, result); | ||
359 | return result; | 333 | return result; |
360 | } | 334 | } |
361 | 335 | ||
diff --git a/drivers/uwb/i1480/i1480u-wlp/rx.c b/drivers/uwb/i1480/i1480u-wlp/rx.c index 9fc035354a76..34f4cf9a7d34 100644 --- a/drivers/uwb/i1480/i1480u-wlp/rx.c +++ b/drivers/uwb/i1480/i1480u-wlp/rx.c | |||
@@ -68,11 +68,7 @@ | |||
68 | #include <linux/etherdevice.h> | 68 | #include <linux/etherdevice.h> |
69 | #include "i1480u-wlp.h" | 69 | #include "i1480u-wlp.h" |
70 | 70 | ||
71 | #define D_LOCAL 0 | 71 | /* |
72 | #include <linux/uwb/debug.h> | ||
73 | |||
74 | |||
75 | /** | ||
76 | * Setup the RX context | 72 | * Setup the RX context |
77 | * | 73 | * |
78 | * Each URB is provided with a transfer_buffer that is the data field | 74 | * Each URB is provided with a transfer_buffer that is the data field |
@@ -129,7 +125,7 @@ error: | |||
129 | } | 125 | } |
130 | 126 | ||
131 | 127 | ||
132 | /** Release resources associated to the rx context */ | 128 | /* Release resources associated to the rx context */ |
133 | void i1480u_rx_release(struct i1480u *i1480u) | 129 | void i1480u_rx_release(struct i1480u *i1480u) |
134 | { | 130 | { |
135 | int cnt; | 131 | int cnt; |
@@ -155,7 +151,7 @@ void i1480u_rx_unlink_urbs(struct i1480u *i1480u) | |||
155 | } | 151 | } |
156 | } | 152 | } |
157 | 153 | ||
158 | /** Fix an out-of-sequence packet */ | 154 | /* Fix an out-of-sequence packet */ |
159 | #define i1480u_fix(i1480u, msg...) \ | 155 | #define i1480u_fix(i1480u, msg...) \ |
160 | do { \ | 156 | do { \ |
161 | if (printk_ratelimit()) \ | 157 | if (printk_ratelimit()) \ |
@@ -166,7 +162,7 @@ do { \ | |||
166 | } while (0) | 162 | } while (0) |
167 | 163 | ||
168 | 164 | ||
169 | /** Drop an out-of-sequence packet */ | 165 | /* Drop an out-of-sequence packet */ |
170 | #define i1480u_drop(i1480u, msg...) \ | 166 | #define i1480u_drop(i1480u, msg...) \ |
171 | do { \ | 167 | do { \ |
172 | if (printk_ratelimit()) \ | 168 | if (printk_ratelimit()) \ |
@@ -177,7 +173,7 @@ do { \ | |||
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 | * We first pass the incoming frame to WLP substack for verification. It | 178 | * We first pass the incoming frame to WLP substack for verification. It |
183 | * may also be a WLP association frame in which case WLP will take over the | 179 | * may also be a WLP association frame in which case WLP will take over the |
@@ -192,18 +188,11 @@ void i1480u_skb_deliver(struct i1480u *i1480u) | |||
192 | struct net_device *net_dev = i1480u->net_dev; | 188 | struct net_device *net_dev = i1480u->net_dev; |
193 | struct device *dev = &i1480u->usb_iface->dev; | 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 | should_parse = wlp_receive_frame(dev, &i1480u->wlp, i1480u->rx_skb, | 191 | should_parse = wlp_receive_frame(dev, &i1480u->wlp, i1480u->rx_skb, |
199 | &i1480u->rx_srcaddr); | 192 | &i1480u->rx_srcaddr); |
200 | if (!should_parse) | 193 | if (!should_parse) |
201 | goto out; | 194 | goto out; |
202 | i1480u->rx_skb->protocol = eth_type_trans(i1480u->rx_skb, net_dev); | 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 | i1480u->stats.rx_packets++; | 196 | i1480u->stats.rx_packets++; |
208 | i1480u->stats.rx_bytes += i1480u->rx_untd_pkt_size; | 197 | i1480u->stats.rx_bytes += i1480u->rx_untd_pkt_size; |
209 | net_dev->last_rx = jiffies; | 198 | net_dev->last_rx = jiffies; |
@@ -216,7 +205,7 @@ out: | |||
216 | } | 205 | } |
217 | 206 | ||
218 | 207 | ||
219 | /** | 208 | /* |
220 | * Process a buffer of data received from the USB RX endpoint | 209 | * Process a buffer of data received from the USB RX endpoint |
221 | * | 210 | * |
222 | * First fragment arrives with next or last fragment. All other fragments | 211 | * First fragment arrives with next or last fragment. All other fragments |
@@ -404,7 +393,7 @@ out: | |||
404 | } | 393 | } |
405 | 394 | ||
406 | 395 | ||
407 | /** | 396 | /* |
408 | * Called when an RX URB has finished receiving or has found some kind | 397 | * Called when an RX URB has finished receiving or has found some kind |
409 | * of error condition. | 398 | * of error condition. |
410 | * | 399 | * |
diff --git a/drivers/uwb/i1480/i1480u-wlp/tx.c b/drivers/uwb/i1480/i1480u-wlp/tx.c index 3426bfb68240..39032cc3503e 100644 --- a/drivers/uwb/i1480/i1480u-wlp/tx.c +++ b/drivers/uwb/i1480/i1480u-wlp/tx.c | |||
@@ -55,8 +55,6 @@ | |||
55 | */ | 55 | */ |
56 | 56 | ||
57 | #include "i1480u-wlp.h" | 57 | #include "i1480u-wlp.h" |
58 | #define D_LOCAL 5 | ||
59 | #include <linux/uwb/debug.h> | ||
60 | 58 | ||
61 | enum { | 59 | enum { |
62 | /* This is only for Next and Last TX packets */ | 60 | /* This is only for Next and Last TX packets */ |
@@ -64,7 +62,7 @@ enum { | |||
64 | - sizeof(struct untd_hdr_rst), | 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 | static | 66 | static |
69 | void i1480u_tx_free(struct i1480u_tx *wtx) | 67 | void i1480u_tx_free(struct i1480u_tx *wtx) |
70 | { | 68 | { |
@@ -99,7 +97,7 @@ void i1480u_tx_unlink_urbs(struct i1480u *i1480u) | |||
99 | } | 97 | } |
100 | 98 | ||
101 | 99 | ||
102 | /** | 100 | /* |
103 | * Callback for a completed tx USB URB. | 101 | * Callback for a completed tx USB URB. |
104 | * | 102 | * |
105 | * TODO: | 103 | * TODO: |
@@ -149,8 +147,6 @@ void i1480u_tx_cb(struct urb *urb) | |||
149 | <= i1480u->tx_inflight.threshold | 147 | <= i1480u->tx_inflight.threshold |
150 | && netif_queue_stopped(net_dev) | 148 | && netif_queue_stopped(net_dev) |
151 | && i1480u->tx_inflight.threshold != 0) { | 149 | && i1480u->tx_inflight.threshold != 0) { |
152 | if (d_test(2) && printk_ratelimit()) | ||
153 | d_printf(2, dev, "Restart queue. \n"); | ||
154 | netif_start_queue(net_dev); | 150 | netif_start_queue(net_dev); |
155 | atomic_inc(&i1480u->tx_inflight.restart_count); | 151 | atomic_inc(&i1480u->tx_inflight.restart_count); |
156 | } | 152 | } |
@@ -158,7 +154,7 @@ void i1480u_tx_cb(struct urb *urb) | |||
158 | } | 154 | } |
159 | 155 | ||
160 | 156 | ||
161 | /** | 157 | /* |
162 | * Given a buffer that doesn't fit in a single fragment, create an | 158 | * Given a buffer that doesn't fit in a single fragment, create an |
163 | * scatter/gather structure for delivery to the USB pipe. | 159 | * scatter/gather structure for delivery to the USB pipe. |
164 | * | 160 | * |
@@ -253,15 +249,11 @@ int i1480u_tx_create_n(struct i1480u_tx *wtx, struct sk_buff *skb, | |||
253 | /* Now do each remaining fragment */ | 249 | /* Now do each remaining fragment */ |
254 | result = -EINVAL; | 250 | result = -EINVAL; |
255 | while (pl_size_left > 0) { | 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 | if (buf_itr + sizeof(*untd_hdr_rst) - wtx->buf | 252 | if (buf_itr + sizeof(*untd_hdr_rst) - wtx->buf |
259 | > wtx->buf_size) { | 253 | > wtx->buf_size) { |
260 | printk(KERN_ERR "BUG: no space for header\n"); | 254 | printk(KERN_ERR "BUG: no space for header\n"); |
261 | goto error_bug; | 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 | untd_hdr_rst = buf_itr; | 257 | untd_hdr_rst = buf_itr; |
266 | buf_itr += sizeof(*untd_hdr_rst); | 258 | buf_itr += sizeof(*untd_hdr_rst); |
267 | if (pl_size_left > i1480u_MAX_PL_SIZE) { | 259 | if (pl_size_left > i1480u_MAX_PL_SIZE) { |
@@ -271,9 +263,6 @@ int i1480u_tx_create_n(struct i1480u_tx *wtx, struct sk_buff *skb, | |||
271 | frg_pl_size = pl_size_left; | 263 | frg_pl_size = pl_size_left; |
272 | untd_hdr_set_type(&untd_hdr_rst->hdr, i1480u_PKT_FRAG_LST); | 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 | untd_hdr_set_rx_tx(&untd_hdr_rst->hdr, 0); | 266 | untd_hdr_set_rx_tx(&untd_hdr_rst->hdr, 0); |
278 | untd_hdr_rst->hdr.len = cpu_to_le16(frg_pl_size); | 267 | untd_hdr_rst->hdr.len = cpu_to_le16(frg_pl_size); |
279 | untd_hdr_rst->padding = 0; | 268 | untd_hdr_rst->padding = 0; |
@@ -286,9 +275,6 @@ int i1480u_tx_create_n(struct i1480u_tx *wtx, struct sk_buff *skb, | |||
286 | buf_itr += frg_pl_size; | 275 | buf_itr += frg_pl_size; |
287 | pl_itr += frg_pl_size; | 276 | pl_itr += frg_pl_size; |
288 | pl_size_left -= frg_pl_size; | 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 | dev_kfree_skb_irq(skb); | 279 | dev_kfree_skb_irq(skb); |
294 | return 0; | 280 | return 0; |
@@ -308,7 +294,7 @@ error_buf_alloc: | |||
308 | } | 294 | } |
309 | 295 | ||
310 | 296 | ||
311 | /** | 297 | /* |
312 | * Given a buffer that fits in a single fragment, fill out a @wtx | 298 | * Given a buffer that fits in a single fragment, fill out a @wtx |
313 | * struct for transmitting it down the USB pipe. | 299 | * struct for transmitting it down the USB pipe. |
314 | * | 300 | * |
@@ -346,7 +332,7 @@ int i1480u_tx_create_1(struct i1480u_tx *wtx, struct sk_buff *skb, | |||
346 | } | 332 | } |
347 | 333 | ||
348 | 334 | ||
349 | /** | 335 | /* |
350 | * Given a skb to transmit, massage it to become palatable for the TX pipe | 336 | * Given a skb to transmit, massage it to become palatable for the TX pipe |
351 | * | 337 | * |
352 | * This will break the buffer in chunks smaller than | 338 | * This will break the buffer in chunks smaller than |
@@ -425,7 +411,7 @@ error_wtx_alloc: | |||
425 | return NULL; | 411 | return NULL; |
426 | } | 412 | } |
427 | 413 | ||
428 | /** | 414 | /* |
429 | * Actual fragmentation and transmission of frame | 415 | * Actual fragmentation and transmission of frame |
430 | * | 416 | * |
431 | * @wlp: WLP substack data structure | 417 | * @wlp: WLP substack data structure |
@@ -447,20 +433,12 @@ int i1480u_xmit_frame(struct wlp *wlp, struct sk_buff *skb, | |||
447 | struct i1480u_tx *wtx; | 433 | struct i1480u_tx *wtx; |
448 | struct wlp_tx_hdr *wlp_tx_hdr; | 434 | struct wlp_tx_hdr *wlp_tx_hdr; |
449 | static unsigned char dev_bcast[2] = { 0xff, 0xff }; | 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 | BUG_ON(i1480u->wlp.rc == NULL); | 437 | BUG_ON(i1480u->wlp.rc == NULL); |
457 | if ((net_dev->flags & IFF_UP) == 0) | 438 | if ((net_dev->flags & IFF_UP) == 0) |
458 | goto out; | 439 | goto out; |
459 | result = -EBUSY; | 440 | result = -EBUSY; |
460 | if (atomic_read(&i1480u->tx_inflight.count) >= i1480u->tx_inflight.max) { | 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 | netif_stop_queue(net_dev); | 442 | netif_stop_queue(net_dev); |
465 | goto error_max_inflight; | 443 | goto error_max_inflight; |
466 | } | 444 | } |
@@ -489,21 +467,6 @@ int i1480u_xmit_frame(struct wlp *wlp, struct sk_buff *skb, | |||
489 | wlp_tx_hdr_set_delivery_id_type(wlp_tx_hdr, i1480u->options.pca_base_priority); | 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 | result = usb_submit_urb(wtx->urb, GFP_ATOMIC); /* Go baby */ | 470 | result = usb_submit_urb(wtx->urb, GFP_ATOMIC); /* Go baby */ |
508 | if (result < 0) { | 471 | if (result < 0) { |
509 | dev_err(dev, "TX: cannot submit URB: %d\n", result); | 472 | dev_err(dev, "TX: cannot submit URB: %d\n", result); |
@@ -513,8 +476,6 @@ int i1480u_xmit_frame(struct wlp *wlp, struct sk_buff *skb, | |||
513 | } | 476 | } |
514 | atomic_inc(&i1480u->tx_inflight.count); | 477 | atomic_inc(&i1480u->tx_inflight.count); |
515 | net_dev->trans_start = jiffies; | 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 | return result; | 479 | return result; |
519 | 480 | ||
520 | error_tx_urb_submit: | 481 | error_tx_urb_submit: |
@@ -522,13 +483,11 @@ error_tx_urb_submit: | |||
522 | error_wtx_alloc: | 483 | error_wtx_alloc: |
523 | error_max_inflight: | 484 | error_max_inflight: |
524 | out: | 485 | out: |
525 | d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | ||
526 | net_dev, result); | ||
527 | return result; | 486 | return result; |
528 | } | 487 | } |
529 | 488 | ||
530 | 489 | ||
531 | /** | 490 | /* |
532 | * Transmit an skb Called when an skbuf has to be transmitted | 491 | * Transmit an skb Called when an skbuf has to be transmitted |
533 | * | 492 | * |
534 | * The skb is first passed to WLP substack to ensure this is a valid | 493 | * The skb is first passed to WLP substack to ensure this is a valid |
@@ -551,9 +510,6 @@ int i1480u_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | |||
551 | struct device *dev = &i1480u->usb_iface->dev; | 510 | struct device *dev = &i1480u->usb_iface->dev; |
552 | struct uwb_dev_addr dst; | 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 | if ((net_dev->flags & IFF_UP) == 0) | 513 | if ((net_dev->flags & IFF_UP) == 0) |
558 | goto error; | 514 | goto error; |
559 | result = wlp_prepare_tx_frame(dev, &i1480u->wlp, skb, &dst); | 515 | result = wlp_prepare_tx_frame(dev, &i1480u->wlp, skb, &dst); |
@@ -562,31 +518,25 @@ int i1480u_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev) | |||
562 | "Dropping packet.\n", result); | 518 | "Dropping packet.\n", result); |
563 | goto error; | 519 | goto error; |
564 | } else if (result == 1) { | 520 | } else if (result == 1) { |
565 | d_printf(6, dev, "WLP will transmit frame. \n"); | ||
566 | /* trans_start time will be set when WLP actually transmits | 521 | /* trans_start time will be set when WLP actually transmits |
567 | * the frame */ | 522 | * the frame */ |
568 | goto out; | 523 | goto out; |
569 | } | 524 | } |
570 | d_printf(6, dev, "Transmitting frame. \n"); | ||
571 | result = i1480u_xmit_frame(&i1480u->wlp, skb, &dst); | 525 | result = i1480u_xmit_frame(&i1480u->wlp, skb, &dst); |
572 | if (result < 0) { | 526 | if (result < 0) { |
573 | dev_err(dev, "Frame TX failed (%d).\n", result); | 527 | dev_err(dev, "Frame TX failed (%d).\n", result); |
574 | goto error; | 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 | return NETDEV_TX_OK; | 530 | return NETDEV_TX_OK; |
579 | error: | 531 | error: |
580 | dev_kfree_skb_any(skb); | 532 | dev_kfree_skb_any(skb); |
581 | i1480u->stats.tx_dropped++; | 533 | i1480u->stats.tx_dropped++; |
582 | out: | 534 | out: |
583 | d_fnend(6, dev, "(skb %p (%u), net_dev %p) = %d\n", skb, skb->len, | ||
584 | net_dev, result); | ||
585 | return NETDEV_TX_OK; | 535 | return NETDEV_TX_OK; |
586 | } | 536 | } |
587 | 537 | ||
588 | 538 | ||
589 | /** | 539 | /* |
590 | * Called when a pkt transmission doesn't complete in a reasonable period | 540 | * Called when a pkt transmission doesn't complete in a reasonable period |
591 | * Device reset may sleep - do it outside of interrupt context (delayed) | 541 | * Device reset may sleep - do it outside of interrupt context (delayed) |
592 | */ | 542 | */ |