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/wlp | |
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/wlp')
-rw-r--r-- | drivers/uwb/wlp/eda.c | 33 | ||||
-rw-r--r-- | drivers/uwb/wlp/messages.c | 181 | ||||
-rw-r--r-- | drivers/uwb/wlp/sysfs.c | 2 | ||||
-rw-r--r-- | drivers/uwb/wlp/txrx.c | 37 | ||||
-rw-r--r-- | drivers/uwb/wlp/wlp-lc.c | 61 | ||||
-rw-r--r-- | drivers/uwb/wlp/wss-lc.c | 130 |
6 files changed, 48 insertions, 396 deletions
diff --git a/drivers/uwb/wlp/eda.c b/drivers/uwb/wlp/eda.c index cdfe8dfc4340..0b4659e4bbd7 100644 --- a/drivers/uwb/wlp/eda.c +++ b/drivers/uwb/wlp/eda.c | |||
@@ -51,9 +51,7 @@ | |||
51 | * the tag and address of the transmitting neighbor. | 51 | * the tag and address of the transmitting neighbor. |
52 | */ | 52 | */ |
53 | 53 | ||
54 | #define D_LOCAL 5 | ||
55 | #include <linux/netdevice.h> | 54 | #include <linux/netdevice.h> |
56 | #include <linux/uwb/debug.h> | ||
57 | #include <linux/etherdevice.h> | 55 | #include <linux/etherdevice.h> |
58 | #include <linux/wlp.h> | 56 | #include <linux/wlp.h> |
59 | #include "wlp-internal.h" | 57 | #include "wlp-internal.h" |
@@ -304,7 +302,6 @@ int wlp_eda_for_virtual(struct wlp_eda *eda, | |||
304 | { | 302 | { |
305 | int result = 0; | 303 | int result = 0; |
306 | struct wlp *wlp = container_of(eda, struct wlp, eda); | 304 | struct wlp *wlp = container_of(eda, struct wlp, eda); |
307 | struct device *dev = &wlp->rc->uwb_dev.dev; | ||
308 | struct wlp_eda_node *itr; | 305 | struct wlp_eda_node *itr; |
309 | unsigned long flags; | 306 | unsigned long flags; |
310 | int found = 0; | 307 | int found = 0; |
@@ -313,40 +310,14 @@ int wlp_eda_for_virtual(struct wlp_eda *eda, | |||
313 | list_for_each_entry(itr, &eda->cache, list_node) { | 310 | list_for_each_entry(itr, &eda->cache, list_node) { |
314 | if (!memcmp(itr->virt_addr, virt_addr, | 311 | if (!memcmp(itr->virt_addr, virt_addr, |
315 | sizeof(itr->virt_addr))) { | 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 | result = (*function)(wlp, itr, priv); | 313 | result = (*function)(wlp, itr, priv); |
326 | *dev_addr = itr->dev_addr; | 314 | *dev_addr = itr->dev_addr; |
327 | found = 1; | 315 | found = 1; |
328 | break; | 316 | break; |
329 | } else | 317 | } |
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]); | ||
340 | } | 318 | } |
341 | if (!found) { | 319 | 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]); | ||
348 | result = -ENODEV; | 320 | result = -ENODEV; |
349 | } | ||
350 | spin_unlock_irqrestore(&eda->lock, flags); | 321 | spin_unlock_irqrestore(&eda->lock, flags); |
351 | return result; | 322 | return result; |
352 | } | 323 | } |
diff --git a/drivers/uwb/wlp/messages.c b/drivers/uwb/wlp/messages.c index a64cb8241713..aa42fcee4c4f 100644 --- a/drivers/uwb/wlp/messages.c +++ b/drivers/uwb/wlp/messages.c | |||
@@ -24,8 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/wlp.h> | 26 | #include <linux/wlp.h> |
27 | #define D_LOCAL 6 | 27 | |
28 | #include <linux/uwb/debug.h> | ||
29 | #include "wlp-internal.h" | 28 | #include "wlp-internal.h" |
30 | 29 | ||
31 | static | 30 | static |
@@ -105,24 +104,18 @@ static inline void wlp_set_attr_hdr(struct wlp_attr_hdr *hdr, unsigned type, | |||
105 | #define wlp_set(type, type_code, name) \ | 104 | #define wlp_set(type, type_code, name) \ |
106 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value) \ | 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 | wlp_set_attr_hdr(&attr->hdr, type_code, \ | 107 | wlp_set_attr_hdr(&attr->hdr, type_code, \ |
110 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ | 108 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ |
111 | attr->name = value; \ | 109 | attr->name = value; \ |
112 | d_dump(6, NULL, attr, sizeof(*attr)); \ | ||
113 | d_fnend(6, NULL, "(attribute %p)\n", attr); \ | ||
114 | return sizeof(*attr); \ | 110 | return sizeof(*attr); \ |
115 | } | 111 | } |
116 | 112 | ||
117 | #define wlp_pset(type, type_code, name) \ | 113 | #define wlp_pset(type, type_code, name) \ |
118 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value) \ | 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 | wlp_set_attr_hdr(&attr->hdr, type_code, \ | 116 | wlp_set_attr_hdr(&attr->hdr, type_code, \ |
122 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ | 117 | sizeof(*attr) - sizeof(struct wlp_attr_hdr)); \ |
123 | attr->name = *value; \ | 118 | attr->name = *value; \ |
124 | d_dump(6, NULL, attr, sizeof(*attr)); \ | ||
125 | d_fnend(6, NULL, "(attribute %p)\n", attr); \ | ||
126 | return sizeof(*attr); \ | 119 | return sizeof(*attr); \ |
127 | } | 120 | } |
128 | 121 | ||
@@ -139,11 +132,8 @@ static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value) \ | |||
139 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value, \ | 132 | static size_t wlp_set_##name(struct wlp_attr_##name *attr, type value, \ |
140 | size_t len) \ | 133 | size_t len) \ |
141 | { \ | 134 | { \ |
142 | d_fnstart(6, NULL, "(attribute %p)\n", attr); \ | ||
143 | wlp_set_attr_hdr(&attr->hdr, type_code, len); \ | 135 | wlp_set_attr_hdr(&attr->hdr, type_code, len); \ |
144 | memcpy(attr->name, value, len); \ | 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 | return sizeof(*attr) + len; \ | 137 | return sizeof(*attr) + len; \ |
148 | } | 138 | } |
149 | 139 | ||
@@ -182,7 +172,7 @@ static size_t wlp_set_wss_info(struct wlp_attr_wss_info *attr, | |||
182 | size_t datalen; | 172 | size_t datalen; |
183 | void *ptr = attr->wss_info; | 173 | void *ptr = attr->wss_info; |
184 | size_t used = sizeof(*attr); | 174 | size_t used = sizeof(*attr); |
185 | d_fnstart(6, NULL, "(attribute %p)\n", attr); | 175 | |
186 | datalen = sizeof(struct wlp_wss_info) + strlen(wss->name); | 176 | datalen = sizeof(struct wlp_wss_info) + strlen(wss->name); |
187 | wlp_set_attr_hdr(&attr->hdr, WLP_ATTR_WSS_INFO, datalen); | 177 | wlp_set_attr_hdr(&attr->hdr, WLP_ATTR_WSS_INFO, datalen); |
188 | used = wlp_set_wssid(ptr, &wss->wssid); | 178 | used = wlp_set_wssid(ptr, &wss->wssid); |
@@ -190,9 +180,6 @@ static size_t wlp_set_wss_info(struct wlp_attr_wss_info *attr, | |||
190 | used += wlp_set_accept_enrl(ptr + used, wss->accept_enroll); | 180 | used += wlp_set_accept_enrl(ptr + used, wss->accept_enroll); |
191 | used += wlp_set_wss_sec_status(ptr + used, wss->secure_status); | 181 | used += wlp_set_wss_sec_status(ptr + used, wss->secure_status); |
192 | used += wlp_set_wss_bcast(ptr + used, &wss->bcast); | 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 | return sizeof(*attr) + used; | 183 | return sizeof(*attr) + used; |
197 | } | 184 | } |
198 | 185 | ||
@@ -414,7 +401,6 @@ static ssize_t wlp_get_wss_info_attrs(struct wlp *wlp, | |||
414 | size_t used = 0; | 401 | size_t used = 0; |
415 | ssize_t result = -EINVAL; | 402 | ssize_t result = -EINVAL; |
416 | 403 | ||
417 | d_printf(6, dev, "WLP: WSS info: Retrieving WSS name\n"); | ||
418 | result = wlp_get_wss_name(wlp, ptr, info->name, buflen); | 404 | result = wlp_get_wss_name(wlp, ptr, info->name, buflen); |
419 | if (result < 0) { | 405 | if (result < 0) { |
420 | dev_err(dev, "WLP: unable to obtain WSS name from " | 406 | dev_err(dev, "WLP: unable to obtain WSS name from " |
@@ -422,7 +408,7 @@ static ssize_t wlp_get_wss_info_attrs(struct wlp *wlp, | |||
422 | goto error_parse; | 408 | goto error_parse; |
423 | } | 409 | } |
424 | used += result; | 410 | used += result; |
425 | d_printf(6, dev, "WLP: WSS info: Retrieving accept enroll\n"); | 411 | |
426 | result = wlp_get_accept_enrl(wlp, ptr + used, &info->accept_enroll, | 412 | result = wlp_get_accept_enrl(wlp, ptr + used, &info->accept_enroll, |
427 | buflen - used); | 413 | buflen - used); |
428 | if (result < 0) { | 414 | if (result < 0) { |
@@ -437,7 +423,7 @@ static ssize_t wlp_get_wss_info_attrs(struct wlp *wlp, | |||
437 | goto error_parse; | 423 | goto error_parse; |
438 | } | 424 | } |
439 | used += result; | 425 | used += result; |
440 | d_printf(6, dev, "WLP: WSS info: Retrieving secure status\n"); | 426 | |
441 | result = wlp_get_wss_sec_status(wlp, ptr + used, &info->sec_status, | 427 | result = wlp_get_wss_sec_status(wlp, ptr + used, &info->sec_status, |
442 | buflen - used); | 428 | buflen - used); |
443 | if (result < 0) { | 429 | if (result < 0) { |
@@ -452,7 +438,7 @@ static ssize_t wlp_get_wss_info_attrs(struct wlp *wlp, | |||
452 | goto error_parse; | 438 | goto error_parse; |
453 | } | 439 | } |
454 | used += result; | 440 | used += result; |
455 | d_printf(6, dev, "WLP: WSS info: Retrieving broadcast\n"); | 441 | |
456 | result = wlp_get_wss_bcast(wlp, ptr + used, &info->bcast, | 442 | result = wlp_get_wss_bcast(wlp, ptr + used, &info->bcast, |
457 | buflen - used); | 443 | buflen - used); |
458 | if (result < 0) { | 444 | if (result < 0) { |
@@ -530,7 +516,7 @@ static ssize_t wlp_get_wss_info(struct wlp *wlp, struct wlp_attr_wss_info *attr, | |||
530 | len = result; | 516 | len = result; |
531 | used = sizeof(*attr); | 517 | used = sizeof(*attr); |
532 | ptr = attr; | 518 | ptr = attr; |
533 | d_printf(6, dev, "WLP: WSS info: Retrieving WSSID\n"); | 519 | |
534 | result = wlp_get_wssid(wlp, ptr + used, wssid, buflen - used); | 520 | result = wlp_get_wssid(wlp, ptr + used, wssid, buflen - used); |
535 | if (result < 0) { | 521 | if (result < 0) { |
536 | dev_err(dev, "WLP: unable to obtain WSSID from WSS info.\n"); | 522 | dev_err(dev, "WLP: unable to obtain WSSID from WSS info.\n"); |
@@ -553,8 +539,6 @@ static ssize_t wlp_get_wss_info(struct wlp *wlp, struct wlp_attr_wss_info *attr, | |||
553 | goto out; | 539 | goto out; |
554 | } | 540 | } |
555 | result = used; | 541 | result = used; |
556 | d_printf(6, dev, "WLP: Successfully parsed WLP information " | ||
557 | "attribute. used %zu bytes\n", used); | ||
558 | out: | 542 | out: |
559 | return result; | 543 | return result; |
560 | } | 544 | } |
@@ -598,8 +582,6 @@ static ssize_t wlp_get_all_wss_info(struct wlp *wlp, | |||
598 | struct wlp_wssid_e *wssid_e; | 582 | struct wlp_wssid_e *wssid_e; |
599 | char buf[WLP_WSS_UUID_STRSIZE]; | 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 | if (buflen < 0) | 585 | if (buflen < 0) |
604 | goto out; | 586 | goto out; |
605 | 587 | ||
@@ -638,8 +620,7 @@ static ssize_t wlp_get_all_wss_info(struct wlp *wlp, | |||
638 | wss->accept_enroll = wss_info.accept_enroll; | 620 | wss->accept_enroll = wss_info.accept_enroll; |
639 | wss->state = WLP_WSS_STATE_PART_ENROLLED; | 621 | wss->state = WLP_WSS_STATE_PART_ENROLLED; |
640 | wlp_wss_uuid_print(buf, sizeof(buf), &wssid); | 622 | wlp_wss_uuid_print(buf, sizeof(buf), &wssid); |
641 | d_printf(2, dev, "WLP: Found WSS %s. Enrolling.\n", | 623 | dev_dbg(dev, "WLP: Found WSS %s. Enrolling.\n", buf); |
642 | buf); | ||
643 | } else { | 624 | } else { |
644 | wssid_e = wlp_create_wssid_e(wlp, neighbor); | 625 | wssid_e = wlp_create_wssid_e(wlp, neighbor); |
645 | if (wssid_e == NULL) { | 626 | if (wssid_e == NULL) { |
@@ -660,9 +641,6 @@ error_parse: | |||
660 | if (result < 0 && !enroll) /* this was a discovery */ | 641 | if (result < 0 && !enroll) /* this was a discovery */ |
661 | wlp_remove_neighbor_tmp_info(neighbor); | 642 | wlp_remove_neighbor_tmp_info(neighbor); |
662 | out: | 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 | return result; | 644 | return result; |
667 | 645 | ||
668 | } | 646 | } |
@@ -718,7 +696,6 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss, | |||
718 | struct sk_buff *_skb; | 696 | struct sk_buff *_skb; |
719 | void *d1_itr; | 697 | void *d1_itr; |
720 | 698 | ||
721 | d_fnstart(6, dev, "wlp %p\n", wlp); | ||
722 | if (wlp->dev_info == NULL) { | 699 | if (wlp->dev_info == NULL) { |
723 | result = __wlp_setup_device_info(wlp); | 700 | result = __wlp_setup_device_info(wlp); |
724 | if (result < 0) { | 701 | if (result < 0) { |
@@ -728,24 +705,6 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss, | |||
728 | } | 705 | } |
729 | } | 706 | } |
730 | info = wlp->dev_info; | 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 | _skb = dev_alloc_skb(sizeof(*_d1) | 708 | _skb = dev_alloc_skb(sizeof(*_d1) |
750 | + sizeof(struct wlp_attr_uuid_e) | 709 | + sizeof(struct wlp_attr_uuid_e) |
751 | + sizeof(struct wlp_attr_wss_sel_mthd) | 710 | + sizeof(struct wlp_attr_wss_sel_mthd) |
@@ -768,7 +727,6 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss, | |||
768 | goto error; | 727 | goto error; |
769 | } | 728 | } |
770 | _d1 = (void *) _skb->data; | 729 | _d1 = (void *) _skb->data; |
771 | d_printf(6, dev, "D1 starts at %p \n", _d1); | ||
772 | _d1->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); | 730 | _d1->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
773 | _d1->hdr.type = WLP_FRAME_ASSOCIATION; | 731 | _d1->hdr.type = WLP_FRAME_ASSOCIATION; |
774 | _d1->type = WLP_ASSOC_D1; | 732 | _d1->type = WLP_ASSOC_D1; |
@@ -791,25 +749,8 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss, | |||
791 | used += wlp_set_prim_dev_type(d1_itr + used, &info->prim_dev_type); | 749 | used += wlp_set_prim_dev_type(d1_itr + used, &info->prim_dev_type); |
792 | used += wlp_set_wlp_assc_err(d1_itr + used, WLP_ASSOC_ERROR_NONE); | 750 | used += wlp_set_wlp_assc_err(d1_itr + used, WLP_ASSOC_ERROR_NONE); |
793 | skb_put(_skb, sizeof(*_d1) + used); | 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 | *skb = _skb; | 752 | *skb = _skb; |
811 | error: | 753 | error: |
812 | d_fnend(6, dev, "wlp %p, result = %d\n", wlp, result); | ||
813 | return result; | 754 | return result; |
814 | } | 755 | } |
815 | 756 | ||
@@ -837,7 +778,6 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss, | |||
837 | void *d2_itr; | 778 | void *d2_itr; |
838 | size_t mem_needed; | 779 | size_t mem_needed; |
839 | 780 | ||
840 | d_fnstart(6, dev, "wlp %p\n", wlp); | ||
841 | if (wlp->dev_info == NULL) { | 781 | if (wlp->dev_info == NULL) { |
842 | result = __wlp_setup_device_info(wlp); | 782 | result = __wlp_setup_device_info(wlp); |
843 | if (result < 0) { | 783 | if (result < 0) { |
@@ -847,24 +787,6 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss, | |||
847 | } | 787 | } |
848 | } | 788 | } |
849 | info = wlp->dev_info; | 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 | mem_needed = sizeof(*_d2) | 790 | mem_needed = sizeof(*_d2) |
869 | + sizeof(struct wlp_attr_uuid_e) | 791 | + sizeof(struct wlp_attr_uuid_e) |
870 | + sizeof(struct wlp_attr_uuid_r) | 792 | + sizeof(struct wlp_attr_uuid_r) |
@@ -892,7 +814,6 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss, | |||
892 | goto error; | 814 | goto error; |
893 | } | 815 | } |
894 | _d2 = (void *) _skb->data; | 816 | _d2 = (void *) _skb->data; |
895 | d_printf(6, dev, "D2 starts at %p \n", _d2); | ||
896 | _d2->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); | 817 | _d2->hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
897 | _d2->hdr.type = WLP_FRAME_ASSOCIATION; | 818 | _d2->hdr.type = WLP_FRAME_ASSOCIATION; |
898 | _d2->type = WLP_ASSOC_D2; | 819 | _d2->type = WLP_ASSOC_D2; |
@@ -917,11 +838,8 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss, | |||
917 | used += wlp_set_prim_dev_type(d2_itr + used, &info->prim_dev_type); | 838 | used += wlp_set_prim_dev_type(d2_itr + used, &info->prim_dev_type); |
918 | used += wlp_set_wlp_assc_err(d2_itr + used, WLP_ASSOC_ERROR_NONE); | 839 | used += wlp_set_wlp_assc_err(d2_itr + used, WLP_ASSOC_ERROR_NONE); |
919 | skb_put(_skb, sizeof(*_d2) + used); | 840 | skb_put(_skb, sizeof(*_d2) + used); |
920 | d_printf(6, dev, "D2 message:\n"); | ||
921 | d_dump(6, dev, _d2, mem_needed); | ||
922 | *skb = _skb; | 841 | *skb = _skb; |
923 | error: | 842 | error: |
924 | d_fnend(6, dev, "wlp %p, result = %d\n", wlp, result); | ||
925 | return result; | 843 | return result; |
926 | } | 844 | } |
927 | 845 | ||
@@ -947,7 +865,6 @@ int wlp_build_assoc_f0(struct wlp *wlp, struct sk_buff **skb, | |||
947 | struct sk_buff *_skb; | 865 | struct sk_buff *_skb; |
948 | struct wlp_nonce tmp; | 866 | struct wlp_nonce tmp; |
949 | 867 | ||
950 | d_fnstart(6, dev, "wlp %p\n", wlp); | ||
951 | _skb = dev_alloc_skb(sizeof(*f0)); | 868 | _skb = dev_alloc_skb(sizeof(*f0)); |
952 | if (_skb == NULL) { | 869 | if (_skb == NULL) { |
953 | dev_err(dev, "WLP: Unable to allocate memory for F0 " | 870 | dev_err(dev, "WLP: Unable to allocate memory for F0 " |
@@ -955,7 +872,6 @@ int wlp_build_assoc_f0(struct wlp *wlp, struct sk_buff **skb, | |||
955 | goto error_alloc; | 872 | goto error_alloc; |
956 | } | 873 | } |
957 | f0 = (void *) _skb->data; | 874 | f0 = (void *) _skb->data; |
958 | d_printf(6, dev, "F0 starts at %p \n", f0); | ||
959 | f0->f0_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); | 875 | f0->f0_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
960 | f0->f0_hdr.hdr.type = WLP_FRAME_ASSOCIATION; | 876 | f0->f0_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
961 | f0->f0_hdr.type = WLP_ASSOC_F0; | 877 | f0->f0_hdr.type = WLP_ASSOC_F0; |
@@ -969,7 +885,6 @@ int wlp_build_assoc_f0(struct wlp *wlp, struct sk_buff **skb, | |||
969 | *skb = _skb; | 885 | *skb = _skb; |
970 | result = 0; | 886 | result = 0; |
971 | error_alloc: | 887 | error_alloc: |
972 | d_fnend(6, dev, "wlp %p, result %d \n", wlp, result); | ||
973 | return result; | 888 | return result; |
974 | } | 889 | } |
975 | 890 | ||
@@ -1242,12 +1157,9 @@ void wlp_handle_d1_frame(struct work_struct *ws) | |||
1242 | enum wlp_wss_sel_mthd sel_mthd = 0; | 1157 | enum wlp_wss_sel_mthd sel_mthd = 0; |
1243 | struct wlp_device_info dev_info; | 1158 | struct wlp_device_info dev_info; |
1244 | enum wlp_assc_error assc_err; | 1159 | enum wlp_assc_error assc_err; |
1245 | char uuid[WLP_WSS_UUID_STRSIZE]; | ||
1246 | struct sk_buff *resp = NULL; | 1160 | struct sk_buff *resp = NULL; |
1247 | 1161 | ||
1248 | /* Parse D1 frame */ | 1162 | /* Parse D1 frame */ |
1249 | d_fnstart(6, dev, "WLP: handle D1 frame. wlp = %p, skb = %p\n", | ||
1250 | wlp, skb); | ||
1251 | mutex_lock(&wss->mutex); | 1163 | mutex_lock(&wss->mutex); |
1252 | mutex_lock(&wlp->mutex); /* to access wlp->uuid */ | 1164 | mutex_lock(&wlp->mutex); /* to access wlp->uuid */ |
1253 | memset(&dev_info, 0, sizeof(dev_info)); | 1165 | memset(&dev_info, 0, sizeof(dev_info)); |
@@ -1258,30 +1170,6 @@ void wlp_handle_d1_frame(struct work_struct *ws) | |||
1258 | kfree_skb(skb); | 1170 | kfree_skb(skb); |
1259 | goto out; | 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 | kfree_skb(skb); | 1174 | kfree_skb(skb); |
1287 | if (!wlp_uuid_is_set(&wlp->uuid)) { | 1175 | if (!wlp_uuid_is_set(&wlp->uuid)) { |
@@ -1316,7 +1204,6 @@ out: | |||
1316 | kfree(frame_ctx); | 1204 | kfree(frame_ctx); |
1317 | mutex_unlock(&wlp->mutex); | 1205 | mutex_unlock(&wlp->mutex); |
1318 | mutex_unlock(&wss->mutex); | 1206 | mutex_unlock(&wss->mutex); |
1319 | d_fnend(6, dev, "WLP: handle D1 frame. wlp = %p\n", wlp); | ||
1320 | } | 1207 | } |
1321 | 1208 | ||
1322 | /** | 1209 | /** |
@@ -1546,10 +1433,8 @@ int wlp_parse_c3c4_frame(struct wlp *wlp, struct sk_buff *skb, | |||
1546 | void *ptr = skb->data; | 1433 | void *ptr = skb->data; |
1547 | size_t len = skb->len; | 1434 | size_t len = skb->len; |
1548 | size_t used; | 1435 | size_t used; |
1549 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
1550 | struct wlp_frame_assoc *assoc = ptr; | 1436 | struct wlp_frame_assoc *assoc = ptr; |
1551 | 1437 | ||
1552 | d_fnstart(6, dev, "wlp %p, skb %p \n", wlp, skb); | ||
1553 | used = sizeof(*assoc); | 1438 | used = sizeof(*assoc); |
1554 | result = wlp_get_wssid(wlp, ptr + used, wssid, len - used); | 1439 | result = wlp_get_wssid(wlp, ptr + used, wssid, len - used); |
1555 | if (result < 0) { | 1440 | if (result < 0) { |
@@ -1572,14 +1457,7 @@ int wlp_parse_c3c4_frame(struct wlp *wlp, struct sk_buff *skb, | |||
1572 | wlp_assoc_frame_str(assoc->type)); | 1457 | wlp_assoc_frame_str(assoc->type)); |
1573 | goto error_parse; | 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 | error_parse: | 1460 | error_parse: |
1582 | d_fnend(6, dev, "wlp %p, skb %p, result = %d \n", wlp, skb, result); | ||
1583 | return result; | 1461 | return result; |
1584 | } | 1462 | } |
1585 | 1463 | ||
@@ -1600,7 +1478,6 @@ int wlp_build_assoc_c1c2(struct wlp *wlp, struct wlp_wss *wss, | |||
1600 | } *c; | 1478 | } *c; |
1601 | struct sk_buff *_skb; | 1479 | struct sk_buff *_skb; |
1602 | 1480 | ||
1603 | d_fnstart(6, dev, "wlp %p, wss %p \n", wlp, wss); | ||
1604 | _skb = dev_alloc_skb(sizeof(*c)); | 1481 | _skb = dev_alloc_skb(sizeof(*c)); |
1605 | if (_skb == NULL) { | 1482 | if (_skb == NULL) { |
1606 | dev_err(dev, "WLP: Unable to allocate memory for C1/C2 " | 1483 | dev_err(dev, "WLP: Unable to allocate memory for C1/C2 " |
@@ -1608,7 +1485,6 @@ int wlp_build_assoc_c1c2(struct wlp *wlp, struct wlp_wss *wss, | |||
1608 | goto error_alloc; | 1485 | goto error_alloc; |
1609 | } | 1486 | } |
1610 | c = (void *) _skb->data; | 1487 | c = (void *) _skb->data; |
1611 | d_printf(6, dev, "C1/C2 starts at %p \n", c); | ||
1612 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); | 1488 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
1613 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; | 1489 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
1614 | c->c_hdr.type = type; | 1490 | c->c_hdr.type = type; |
@@ -1616,12 +1492,9 @@ int wlp_build_assoc_c1c2(struct wlp *wlp, struct wlp_wss *wss, | |||
1616 | wlp_set_msg_type(&c->c_hdr.msg_type, type); | 1492 | wlp_set_msg_type(&c->c_hdr.msg_type, type); |
1617 | wlp_set_wssid(&c->wssid, &wss->wssid); | 1493 | wlp_set_wssid(&c->wssid, &wss->wssid); |
1618 | skb_put(_skb, sizeof(*c)); | 1494 | skb_put(_skb, sizeof(*c)); |
1619 | d_printf(6, dev, "C1/C2 message:\n"); | ||
1620 | d_dump(6, dev, c, sizeof(*c)); | ||
1621 | *skb = _skb; | 1495 | *skb = _skb; |
1622 | result = 0; | 1496 | result = 0; |
1623 | error_alloc: | 1497 | error_alloc: |
1624 | d_fnend(6, dev, "wlp %p, wss %p, result %d \n", wlp, wss, result); | ||
1625 | return result; | 1498 | return result; |
1626 | } | 1499 | } |
1627 | 1500 | ||
@@ -1660,7 +1533,6 @@ int wlp_build_assoc_c3c4(struct wlp *wlp, struct wlp_wss *wss, | |||
1660 | } *c; | 1533 | } *c; |
1661 | struct sk_buff *_skb; | 1534 | struct sk_buff *_skb; |
1662 | 1535 | ||
1663 | d_fnstart(6, dev, "wlp %p, wss %p \n", wlp, wss); | ||
1664 | _skb = dev_alloc_skb(sizeof(*c)); | 1536 | _skb = dev_alloc_skb(sizeof(*c)); |
1665 | if (_skb == NULL) { | 1537 | if (_skb == NULL) { |
1666 | dev_err(dev, "WLP: Unable to allocate memory for C3/C4 " | 1538 | dev_err(dev, "WLP: Unable to allocate memory for C3/C4 " |
@@ -1668,7 +1540,6 @@ int wlp_build_assoc_c3c4(struct wlp *wlp, struct wlp_wss *wss, | |||
1668 | goto error_alloc; | 1540 | goto error_alloc; |
1669 | } | 1541 | } |
1670 | c = (void *) _skb->data; | 1542 | c = (void *) _skb->data; |
1671 | d_printf(6, dev, "C3/C4 starts at %p \n", c); | ||
1672 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); | 1543 | c->c_hdr.hdr.mux_hdr = cpu_to_le16(WLP_PROTOCOL_ID); |
1673 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; | 1544 | c->c_hdr.hdr.type = WLP_FRAME_ASSOCIATION; |
1674 | c->c_hdr.type = type; | 1545 | c->c_hdr.type = type; |
@@ -1678,12 +1549,9 @@ int wlp_build_assoc_c3c4(struct wlp *wlp, struct wlp_wss *wss, | |||
1678 | wlp_set_wss_tag(&c->wss_tag, wss->tag); | 1549 | wlp_set_wss_tag(&c->wss_tag, wss->tag); |
1679 | wlp_set_wss_virt(&c->wss_virt, &wss->virtual_addr); | 1550 | wlp_set_wss_virt(&c->wss_virt, &wss->virtual_addr); |
1680 | skb_put(_skb, sizeof(*c)); | 1551 | skb_put(_skb, sizeof(*c)); |
1681 | d_printf(6, dev, "C3/C4 message:\n"); | ||
1682 | d_dump(6, dev, c, sizeof(*c)); | ||
1683 | *skb = _skb; | 1552 | *skb = _skb; |
1684 | result = 0; | 1553 | result = 0; |
1685 | error_alloc: | 1554 | error_alloc: |
1686 | d_fnend(6, dev, "wlp %p, wss %p, result %d \n", wlp, wss, result); | ||
1687 | return result; | 1555 | return result; |
1688 | } | 1556 | } |
1689 | 1557 | ||
@@ -1709,10 +1577,7 @@ static int wlp_send_assoc_##type(struct wlp *wlp, struct wlp_wss *wss, \ | |||
1709 | struct device *dev = &wlp->rc->uwb_dev.dev; \ | 1577 | struct device *dev = &wlp->rc->uwb_dev.dev; \ |
1710 | int result; \ | 1578 | int result; \ |
1711 | struct sk_buff *skb = NULL; \ | 1579 | struct sk_buff *skb = NULL; \ |
1712 | d_fnstart(6, dev, "wlp %p, wss %p, neighbor: %02x:%02x\n", \ | 1580 | \ |
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)); \ | ||
1716 | /* Build the frame */ \ | 1581 | /* Build the frame */ \ |
1717 | result = wlp_build_assoc_##type(wlp, wss, &skb); \ | 1582 | result = wlp_build_assoc_##type(wlp, wss, &skb); \ |
1718 | if (result < 0) { \ | 1583 | if (result < 0) { \ |
@@ -1721,9 +1586,6 @@ static int wlp_send_assoc_##type(struct wlp *wlp, struct wlp_wss *wss, \ | |||
1721 | goto error_build_assoc; \ | 1586 | goto error_build_assoc; \ |
1722 | } \ | 1587 | } \ |
1723 | /* Send the frame */ \ | 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 | BUG_ON(wlp->xmit_frame == NULL); \ | 1589 | BUG_ON(wlp->xmit_frame == NULL); \ |
1728 | result = wlp->xmit_frame(wlp, skb, dev_addr); \ | 1590 | result = wlp->xmit_frame(wlp, skb, dev_addr); \ |
1729 | if (result < 0) { \ | 1591 | if (result < 0) { \ |
@@ -1740,8 +1602,6 @@ error_xmit: \ | |||
1740 | /* We could try again ... */ \ | 1602 | /* We could try again ... */ \ |
1741 | dev_kfree_skb_any(skb);/*we need to free if tx fails*/ \ | 1603 | dev_kfree_skb_any(skb);/*we need to free if tx fails*/ \ |
1742 | error_build_assoc: \ | 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 | return result; \ | 1605 | return result; \ |
1746 | } | 1606 | } |
1747 | 1607 | ||
@@ -1794,12 +1654,9 @@ void wlp_handle_c1_frame(struct work_struct *ws) | |||
1794 | struct uwb_dev_addr *src = &frame_ctx->src; | 1654 | struct uwb_dev_addr *src = &frame_ctx->src; |
1795 | int result; | 1655 | int result; |
1796 | struct wlp_uuid wssid; | 1656 | struct wlp_uuid wssid; |
1797 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
1798 | struct sk_buff *resp = NULL; | 1657 | struct sk_buff *resp = NULL; |
1799 | 1658 | ||
1800 | /* Parse C1 frame */ | 1659 | /* Parse C1 frame */ |
1801 | d_fnstart(6, dev, "WLP: handle C1 frame. wlp = %p, c1 = %p\n", | ||
1802 | wlp, c1); | ||
1803 | mutex_lock(&wss->mutex); | 1660 | mutex_lock(&wss->mutex); |
1804 | result = wlp_get_wssid(wlp, (void *)c1 + sizeof(*c1), &wssid, | 1661 | result = wlp_get_wssid(wlp, (void *)c1 + sizeof(*c1), &wssid, |
1805 | len - sizeof(*c1)); | 1662 | len - sizeof(*c1)); |
@@ -1807,12 +1664,8 @@ void wlp_handle_c1_frame(struct work_struct *ws) | |||
1807 | dev_err(dev, "WLP: unable to obtain WSSID from C1 frame.\n"); | 1664 | dev_err(dev, "WLP: unable to obtain WSSID from C1 frame.\n"); |
1808 | goto out; | 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 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) | 1667 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) |
1813 | && wss->state == WLP_WSS_STATE_ACTIVE) { | 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 | /* Construct C2 frame */ | 1669 | /* Construct C2 frame */ |
1817 | result = wlp_build_assoc_c2(wlp, wss, &resp); | 1670 | result = wlp_build_assoc_c2(wlp, wss, &resp); |
1818 | if (result < 0) { | 1671 | if (result < 0) { |
@@ -1820,8 +1673,6 @@ void wlp_handle_c1_frame(struct work_struct *ws) | |||
1820 | goto out; | 1673 | goto out; |
1821 | } | 1674 | } |
1822 | } else { | 1675 | } else { |
1823 | d_printf(6, dev, "WSSID from C1 frame is not known locally " | ||
1824 | "or is not active\n"); | ||
1825 | /* Construct F0 frame */ | 1676 | /* Construct F0 frame */ |
1826 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); | 1677 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); |
1827 | if (result < 0) { | 1678 | if (result < 0) { |
@@ -1830,8 +1681,6 @@ void wlp_handle_c1_frame(struct work_struct *ws) | |||
1830 | } | 1681 | } |
1831 | } | 1682 | } |
1832 | /* Send C2 frame */ | 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 | BUG_ON(wlp->xmit_frame == NULL); | 1684 | BUG_ON(wlp->xmit_frame == NULL); |
1836 | result = wlp->xmit_frame(wlp, resp, src); | 1685 | result = wlp->xmit_frame(wlp, resp, src); |
1837 | if (result < 0) { | 1686 | if (result < 0) { |
@@ -1846,7 +1695,6 @@ out: | |||
1846 | kfree_skb(frame_ctx->skb); | 1695 | kfree_skb(frame_ctx->skb); |
1847 | kfree(frame_ctx); | 1696 | kfree(frame_ctx); |
1848 | mutex_unlock(&wss->mutex); | 1697 | mutex_unlock(&wss->mutex); |
1849 | d_fnend(6, dev, "WLP: handle C1 frame. wlp = %p\n", wlp); | ||
1850 | } | 1698 | } |
1851 | 1699 | ||
1852 | /** | 1700 | /** |
@@ -1868,27 +1716,20 @@ void wlp_handle_c3_frame(struct work_struct *ws) | |||
1868 | struct sk_buff *skb = frame_ctx->skb; | 1716 | struct sk_buff *skb = frame_ctx->skb; |
1869 | struct uwb_dev_addr *src = &frame_ctx->src; | 1717 | struct uwb_dev_addr *src = &frame_ctx->src; |
1870 | int result; | 1718 | int result; |
1871 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
1872 | struct sk_buff *resp = NULL; | 1719 | struct sk_buff *resp = NULL; |
1873 | struct wlp_uuid wssid; | 1720 | struct wlp_uuid wssid; |
1874 | u8 tag; | 1721 | u8 tag; |
1875 | struct uwb_mac_addr virt_addr; | 1722 | struct uwb_mac_addr virt_addr; |
1876 | 1723 | ||
1877 | /* Parse C3 frame */ | 1724 | /* Parse C3 frame */ |
1878 | d_fnstart(6, dev, "WLP: handle C3 frame. wlp = %p, skb = %p\n", | ||
1879 | wlp, skb); | ||
1880 | mutex_lock(&wss->mutex); | 1725 | mutex_lock(&wss->mutex); |
1881 | result = wlp_parse_c3c4_frame(wlp, skb, &wssid, &tag, &virt_addr); | 1726 | result = wlp_parse_c3c4_frame(wlp, skb, &wssid, &tag, &virt_addr); |
1882 | if (result < 0) { | 1727 | if (result < 0) { |
1883 | dev_err(dev, "WLP: unable to obtain values from C3 frame.\n"); | 1728 | dev_err(dev, "WLP: unable to obtain values from C3 frame.\n"); |
1884 | goto out; | 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 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) | 1731 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid)) |
1889 | && wss->state >= WLP_WSS_STATE_ACTIVE) { | 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 | result = wlp_eda_update_node(&wlp->eda, src, wss, | 1733 | result = wlp_eda_update_node(&wlp->eda, src, wss, |
1893 | (void *) virt_addr.data, tag, | 1734 | (void *) virt_addr.data, tag, |
1894 | WLP_WSS_CONNECTED); | 1735 | WLP_WSS_CONNECTED); |
@@ -1913,8 +1754,6 @@ void wlp_handle_c3_frame(struct work_struct *ws) | |||
1913 | } | 1754 | } |
1914 | } | 1755 | } |
1915 | } else { | 1756 | } else { |
1916 | d_printf(6, dev, "WSSID from C3 frame is not known locally " | ||
1917 | "or is not active\n"); | ||
1918 | /* Construct F0 frame */ | 1757 | /* Construct F0 frame */ |
1919 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); | 1758 | result = wlp_build_assoc_f0(wlp, &resp, WLP_ASSOC_ERROR_INV); |
1920 | if (result < 0) { | 1759 | if (result < 0) { |
@@ -1923,8 +1762,6 @@ void wlp_handle_c3_frame(struct work_struct *ws) | |||
1923 | } | 1762 | } |
1924 | } | 1763 | } |
1925 | /* Send C4 frame */ | 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 | BUG_ON(wlp->xmit_frame == NULL); | 1765 | BUG_ON(wlp->xmit_frame == NULL); |
1929 | result = wlp->xmit_frame(wlp, resp, src); | 1766 | result = wlp->xmit_frame(wlp, resp, src); |
1930 | if (result < 0) { | 1767 | if (result < 0) { |
@@ -1939,8 +1776,6 @@ out: | |||
1939 | kfree_skb(frame_ctx->skb); | 1776 | kfree_skb(frame_ctx->skb); |
1940 | kfree(frame_ctx); | 1777 | kfree(frame_ctx); |
1941 | mutex_unlock(&wss->mutex); | 1778 | mutex_unlock(&wss->mutex); |
1942 | d_fnend(6, dev, "WLP: handle C3 frame. wlp = %p, skb = %p\n", | ||
1943 | wlp, skb); | ||
1944 | } | 1779 | } |
1945 | 1780 | ||
1946 | 1781 | ||
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c index 1bb9b1f97d47..0370399ff4bb 100644 --- a/drivers/uwb/wlp/sysfs.c +++ b/drivers/uwb/wlp/sysfs.c | |||
@@ -23,8 +23,8 @@ | |||
23 | * FIXME: Docs | 23 | * FIXME: Docs |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | |||
27 | #include <linux/wlp.h> | 26 | #include <linux/wlp.h> |
27 | |||
28 | #include "wlp-internal.h" | 28 | #include "wlp-internal.h" |
29 | 29 | ||
30 | static | 30 | static |
diff --git a/drivers/uwb/wlp/txrx.c b/drivers/uwb/wlp/txrx.c index c701bd1a2887..cd2035768b47 100644 --- a/drivers/uwb/wlp/txrx.c +++ b/drivers/uwb/wlp/txrx.c | |||
@@ -26,12 +26,10 @@ | |||
26 | 26 | ||
27 | #include <linux/etherdevice.h> | 27 | #include <linux/etherdevice.h> |
28 | #include <linux/wlp.h> | 28 | #include <linux/wlp.h> |
29 | #define D_LOCAL 5 | ||
30 | #include <linux/uwb/debug.h> | ||
31 | #include "wlp-internal.h" | ||
32 | 29 | ||
30 | #include "wlp-internal.h" | ||
33 | 31 | ||
34 | /** | 32 | /* |
35 | * Direct incoming association msg to correct parsing routine | 33 | * Direct incoming association msg to correct parsing routine |
36 | * | 34 | * |
37 | * We only expect D1, E1, C1, C3 messages as new. All other incoming | 35 | * We only expect D1, E1, C1, C3 messages as new. All other incoming |
@@ -48,35 +46,31 @@ void wlp_direct_assoc_frame(struct wlp *wlp, struct sk_buff *skb, | |||
48 | struct device *dev = &wlp->rc->uwb_dev.dev; | 46 | struct device *dev = &wlp->rc->uwb_dev.dev; |
49 | struct wlp_frame_assoc *assoc = (void *) skb->data; | 47 | struct wlp_frame_assoc *assoc = (void *) skb->data; |
50 | struct wlp_assoc_frame_ctx *frame_ctx; | 48 | struct wlp_assoc_frame_ctx *frame_ctx; |
51 | d_fnstart(5, dev, "wlp %p, skb %p\n", wlp, skb); | 49 | |
52 | frame_ctx = kmalloc(sizeof(*frame_ctx), GFP_ATOMIC); | 50 | frame_ctx = kmalloc(sizeof(*frame_ctx), GFP_ATOMIC); |
53 | if (frame_ctx == NULL) { | 51 | if (frame_ctx == NULL) { |
54 | dev_err(dev, "WLP: Unable to allocate memory for association " | 52 | dev_err(dev, "WLP: Unable to allocate memory for association " |
55 | "frame handling.\n"); | 53 | "frame handling.\n"); |
56 | kfree_skb(skb); | 54 | kfree_skb(skb); |
57 | goto out; | 55 | return; |
58 | } | 56 | } |
59 | frame_ctx->wlp = wlp; | 57 | frame_ctx->wlp = wlp; |
60 | frame_ctx->skb = skb; | 58 | frame_ctx->skb = skb; |
61 | frame_ctx->src = *src; | 59 | frame_ctx->src = *src; |
62 | switch (assoc->type) { | 60 | switch (assoc->type) { |
63 | case WLP_ASSOC_D1: | 61 | case WLP_ASSOC_D1: |
64 | d_printf(5, dev, "Received a D1 frame.\n"); | ||
65 | INIT_WORK(&frame_ctx->ws, wlp_handle_d1_frame); | 62 | INIT_WORK(&frame_ctx->ws, wlp_handle_d1_frame); |
66 | schedule_work(&frame_ctx->ws); | 63 | schedule_work(&frame_ctx->ws); |
67 | break; | 64 | break; |
68 | case WLP_ASSOC_E1: | 65 | case WLP_ASSOC_E1: |
69 | d_printf(5, dev, "Received a E1 frame. FIXME?\n"); | ||
70 | kfree_skb(skb); /* Temporary until we handle it */ | 66 | kfree_skb(skb); /* Temporary until we handle it */ |
71 | kfree(frame_ctx); /* Temporary until we handle it */ | 67 | kfree(frame_ctx); /* Temporary until we handle it */ |
72 | break; | 68 | break; |
73 | case WLP_ASSOC_C1: | 69 | case WLP_ASSOC_C1: |
74 | d_printf(5, dev, "Received a C1 frame.\n"); | ||
75 | INIT_WORK(&frame_ctx->ws, wlp_handle_c1_frame); | 70 | INIT_WORK(&frame_ctx->ws, wlp_handle_c1_frame); |
76 | schedule_work(&frame_ctx->ws); | 71 | schedule_work(&frame_ctx->ws); |
77 | break; | 72 | break; |
78 | case WLP_ASSOC_C3: | 73 | case WLP_ASSOC_C3: |
79 | d_printf(5, dev, "Received a C3 frame.\n"); | ||
80 | INIT_WORK(&frame_ctx->ws, wlp_handle_c3_frame); | 74 | INIT_WORK(&frame_ctx->ws, wlp_handle_c3_frame); |
81 | schedule_work(&frame_ctx->ws); | 75 | schedule_work(&frame_ctx->ws); |
82 | break; | 76 | break; |
@@ -87,11 +81,9 @@ void wlp_direct_assoc_frame(struct wlp *wlp, struct sk_buff *skb, | |||
87 | kfree(frame_ctx); | 81 | kfree(frame_ctx); |
88 | break; | 82 | break; |
89 | } | 83 | } |
90 | out: | ||
91 | d_fnend(5, dev, "wlp %p\n", wlp); | ||
92 | } | 84 | } |
93 | 85 | ||
94 | /** | 86 | /* |
95 | * Process incoming association frame | 87 | * Process incoming association frame |
96 | * | 88 | * |
97 | * Although it could be possible to deal with some incoming association | 89 | * Although it could be possible to deal with some incoming association |
@@ -112,7 +104,6 @@ void wlp_receive_assoc_frame(struct wlp *wlp, struct sk_buff *skb, | |||
112 | struct wlp_frame_assoc *assoc = (void *) skb->data; | 104 | struct wlp_frame_assoc *assoc = (void *) skb->data; |
113 | struct wlp_session *session = wlp->session; | 105 | struct wlp_session *session = wlp->session; |
114 | u8 version; | 106 | u8 version; |
115 | d_fnstart(5, dev, "wlp %p, skb %p\n", wlp, skb); | ||
116 | 107 | ||
117 | if (wlp_get_version(wlp, &assoc->version, &version, | 108 | if (wlp_get_version(wlp, &assoc->version, &version, |
118 | sizeof(assoc->version)) < 0) | 109 | sizeof(assoc->version)) < 0) |
@@ -150,14 +141,12 @@ void wlp_receive_assoc_frame(struct wlp *wlp, struct sk_buff *skb, | |||
150 | } else { | 141 | } else { |
151 | wlp_direct_assoc_frame(wlp, skb, src); | 142 | wlp_direct_assoc_frame(wlp, skb, src); |
152 | } | 143 | } |
153 | d_fnend(5, dev, "wlp %p\n", wlp); | ||
154 | return; | 144 | return; |
155 | error: | 145 | error: |
156 | kfree_skb(skb); | 146 | kfree_skb(skb); |
157 | d_fnend(5, dev, "wlp %p\n", wlp); | ||
158 | } | 147 | } |
159 | 148 | ||
160 | /** | 149 | /* |
161 | * Verify incoming frame is from connected neighbor, prep to pass to WLP client | 150 | * Verify incoming frame is from connected neighbor, prep to pass to WLP client |
162 | * | 151 | * |
163 | * Verification proceeds according to WLP 0.99 [7.3.1]. The source address | 152 | * Verification proceeds according to WLP 0.99 [7.3.1]. The source address |
@@ -176,7 +165,6 @@ int wlp_verify_prep_rx_frame(struct wlp *wlp, struct sk_buff *skb, | |||
176 | struct wlp_eda_node eda_entry; | 165 | struct wlp_eda_node eda_entry; |
177 | struct wlp_frame_std_abbrv_hdr *hdr = (void *) skb->data; | 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 | /*verify*/ | 168 | /*verify*/ |
181 | result = wlp_copy_eda_node(&wlp->eda, src, &eda_entry); | 169 | result = wlp_copy_eda_node(&wlp->eda, src, &eda_entry); |
182 | if (result < 0) { | 170 | if (result < 0) { |
@@ -207,11 +195,10 @@ int wlp_verify_prep_rx_frame(struct wlp *wlp, struct sk_buff *skb, | |||
207 | /*prep*/ | 195 | /*prep*/ |
208 | skb_pull(skb, sizeof(*hdr)); | 196 | skb_pull(skb, sizeof(*hdr)); |
209 | out: | 197 | out: |
210 | d_fnend(6, dev, "wlp %p, skb %p, result = %d \n", wlp, skb, result); | ||
211 | return result; | 198 | return result; |
212 | } | 199 | } |
213 | 200 | ||
214 | /** | 201 | /* |
215 | * Receive a WLP frame from device | 202 | * Receive a WLP frame from device |
216 | * | 203 | * |
217 | * @returns: 1 if calling function should free the skb | 204 | * @returns: 1 if calling function should free the skb |
@@ -226,14 +213,12 @@ int wlp_receive_frame(struct device *dev, struct wlp *wlp, struct sk_buff *skb, | |||
226 | struct wlp_frame_hdr *hdr; | 213 | struct wlp_frame_hdr *hdr; |
227 | int result = 0; | 214 | int result = 0; |
228 | 215 | ||
229 | d_fnstart(6, dev, "skb (%p), len (%u)\n", skb, len); | ||
230 | if (len < sizeof(*hdr)) { | 216 | if (len < sizeof(*hdr)) { |
231 | dev_err(dev, "Not enough data to parse WLP header.\n"); | 217 | dev_err(dev, "Not enough data to parse WLP header.\n"); |
232 | result = -EINVAL; | 218 | result = -EINVAL; |
233 | goto out; | 219 | goto out; |
234 | } | 220 | } |
235 | hdr = ptr; | 221 | hdr = ptr; |
236 | d_dump(6, dev, hdr, sizeof(*hdr)); | ||
237 | if (le16_to_cpu(hdr->mux_hdr) != WLP_PROTOCOL_ID) { | 222 | if (le16_to_cpu(hdr->mux_hdr) != WLP_PROTOCOL_ID) { |
238 | dev_err(dev, "Not a WLP frame type.\n"); | 223 | dev_err(dev, "Not a WLP frame type.\n"); |
239 | result = -EINVAL; | 224 | result = -EINVAL; |
@@ -270,7 +255,6 @@ int wlp_receive_frame(struct device *dev, struct wlp *wlp, struct sk_buff *skb, | |||
270 | "WLP header.\n"); | 255 | "WLP header.\n"); |
271 | goto out; | 256 | goto out; |
272 | } | 257 | } |
273 | d_printf(5, dev, "Association frame received.\n"); | ||
274 | wlp_receive_assoc_frame(wlp, skb, src); | 258 | wlp_receive_assoc_frame(wlp, skb, src); |
275 | break; | 259 | break; |
276 | default: | 260 | default: |
@@ -283,13 +267,12 @@ out: | |||
283 | kfree_skb(skb); | 267 | kfree_skb(skb); |
284 | result = 0; | 268 | result = 0; |
285 | } | 269 | } |
286 | d_fnend(6, dev, "skb (%p)\n", skb); | ||
287 | return result; | 270 | return result; |
288 | } | 271 | } |
289 | EXPORT_SYMBOL_GPL(wlp_receive_frame); | 272 | EXPORT_SYMBOL_GPL(wlp_receive_frame); |
290 | 273 | ||
291 | 274 | ||
292 | /** | 275 | /* |
293 | * Verify frame from network stack, prepare for further transmission | 276 | * Verify frame from network stack, prepare for further transmission |
294 | * | 277 | * |
295 | * @skb: the socket buffer that needs to be prepared for transmission (it | 278 | * @skb: the socket buffer that needs to be prepared for transmission (it |
@@ -343,9 +326,7 @@ int wlp_prepare_tx_frame(struct device *dev, struct wlp *wlp, | |||
343 | int result = -EINVAL; | 326 | int result = -EINVAL; |
344 | struct ethhdr *eth_hdr = (void *) skb->data; | 327 | struct ethhdr *eth_hdr = (void *) skb->data; |
345 | 328 | ||
346 | d_fnstart(6, dev, "wlp (%p), skb (%p) \n", wlp, skb); | ||
347 | if (is_broadcast_ether_addr(eth_hdr->h_dest)) { | 329 | if (is_broadcast_ether_addr(eth_hdr->h_dest)) { |
348 | d_printf(6, dev, "WLP: handling broadcast frame. \n"); | ||
349 | result = wlp_eda_for_each(&wlp->eda, wlp_wss_send_copy, skb); | 330 | result = wlp_eda_for_each(&wlp->eda, wlp_wss_send_copy, skb); |
350 | if (result < 0) { | 331 | if (result < 0) { |
351 | if (printk_ratelimit()) | 332 | if (printk_ratelimit()) |
@@ -357,7 +338,6 @@ int wlp_prepare_tx_frame(struct device *dev, struct wlp *wlp, | |||
357 | result = 1; | 338 | result = 1; |
358 | /* Frame will be transmitted by WLP. */ | 339 | /* Frame will be transmitted by WLP. */ |
359 | } else { | 340 | } else { |
360 | d_printf(6, dev, "WLP: handling unicast frame. \n"); | ||
361 | result = wlp_eda_for_virtual(&wlp->eda, eth_hdr->h_dest, dst, | 341 | result = wlp_eda_for_virtual(&wlp->eda, eth_hdr->h_dest, dst, |
362 | wlp_wss_prep_hdr, skb); | 342 | wlp_wss_prep_hdr, skb); |
363 | if (unlikely(result < 0)) { | 343 | if (unlikely(result < 0)) { |
@@ -368,7 +348,6 @@ int wlp_prepare_tx_frame(struct device *dev, struct wlp *wlp, | |||
368 | } | 348 | } |
369 | } | 349 | } |
370 | out: | 350 | out: |
371 | d_fnend(6, dev, "wlp (%p), skb (%p). result = %d \n", wlp, skb, result); | ||
372 | return result; | 351 | return result; |
373 | } | 352 | } |
374 | EXPORT_SYMBOL_GPL(wlp_prepare_tx_frame); | 353 | EXPORT_SYMBOL_GPL(wlp_prepare_tx_frame); |
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c index e531093c4162..13db739c4e39 100644 --- a/drivers/uwb/wlp/wlp-lc.c +++ b/drivers/uwb/wlp/wlp-lc.c | |||
@@ -21,12 +21,9 @@ | |||
21 | * | 21 | * |
22 | * FIXME: docs | 22 | * FIXME: docs |
23 | */ | 23 | */ |
24 | |||
25 | #include <linux/wlp.h> | 24 | #include <linux/wlp.h> |
26 | #define D_LOCAL 6 | ||
27 | #include <linux/uwb/debug.h> | ||
28 | #include "wlp-internal.h" | ||
29 | 25 | ||
26 | #include "wlp-internal.h" | ||
30 | 27 | ||
31 | static | 28 | static |
32 | void wlp_neighbor_init(struct wlp_neighbor_e *neighbor) | 29 | void wlp_neighbor_init(struct wlp_neighbor_e *neighbor) |
@@ -61,11 +58,6 @@ int __wlp_alloc_device_info(struct wlp *wlp) | |||
61 | static | 58 | static |
62 | void __wlp_fill_device_info(struct wlp *wlp) | 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 | wlp->fill_device_info(wlp, wlp->dev_info); | 61 | wlp->fill_device_info(wlp, wlp->dev_info); |
70 | } | 62 | } |
71 | 63 | ||
@@ -127,7 +119,7 @@ void wlp_remove_neighbor_tmp_info(struct wlp_neighbor_e *neighbor) | |||
127 | } | 119 | } |
128 | } | 120 | } |
129 | 121 | ||
130 | /** | 122 | /* |
131 | * Populate WLP neighborhood cache with neighbor information | 123 | * Populate WLP neighborhood cache with neighbor information |
132 | * | 124 | * |
133 | * A new neighbor is found. If it is discoverable then we add it to the | 125 | * A new neighbor is found. If it is discoverable then we add it to the |
@@ -141,10 +133,7 @@ int wlp_add_neighbor(struct wlp *wlp, struct uwb_dev *dev) | |||
141 | int discoverable; | 133 | int discoverable; |
142 | struct wlp_neighbor_e *neighbor; | 134 | struct wlp_neighbor_e *neighbor; |
143 | 135 | ||
144 | d_fnstart(6, &dev->dev, "uwb %p \n", dev); | 136 | /* |
145 | d_printf(6, &dev->dev, "Found neighbor device %02x:%02x \n", | ||
146 | dev->dev_addr.data[1], dev->dev_addr.data[0]); | ||
147 | /** | ||
148 | * FIXME: | 137 | * FIXME: |
149 | * Use contents of WLP IE found in beacon cache to determine if | 138 | * Use contents of WLP IE found in beacon cache to determine if |
150 | * neighbor is discoverable. | 139 | * neighbor is discoverable. |
@@ -167,7 +156,6 @@ int wlp_add_neighbor(struct wlp *wlp, struct uwb_dev *dev) | |||
167 | list_add(&neighbor->node, &wlp->neighbors); | 156 | list_add(&neighbor->node, &wlp->neighbors); |
168 | } | 157 | } |
169 | error_no_mem: | 158 | error_no_mem: |
170 | d_fnend(6, &dev->dev, "uwb %p, result = %d \n", dev, result); | ||
171 | return result; | 159 | return result; |
172 | } | 160 | } |
173 | 161 | ||
@@ -255,8 +243,6 @@ int wlp_d1d2_exchange(struct wlp *wlp, struct wlp_neighbor_e *neighbor, | |||
255 | dev_err(dev, "Unable to send D1 frame to neighbor " | 243 | dev_err(dev, "Unable to send D1 frame to neighbor " |
256 | "%02x:%02x (%d)\n", dev_addr->data[1], | 244 | "%02x:%02x (%d)\n", dev_addr->data[1], |
257 | dev_addr->data[0], result); | 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 | goto out; | 246 | goto out; |
261 | } | 247 | } |
262 | /* Create session, wait for response */ | 248 | /* Create session, wait for response */ |
@@ -284,8 +270,6 @@ int wlp_d1d2_exchange(struct wlp *wlp, struct wlp_neighbor_e *neighbor, | |||
284 | /* Parse message in session->data: it will be either D2 or F0 */ | 270 | /* Parse message in session->data: it will be either D2 or F0 */ |
285 | skb = session.data; | 271 | skb = session.data; |
286 | resp = (void *) skb->data; | 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 | if (resp->type == WLP_ASSOC_F0) { | 274 | if (resp->type == WLP_ASSOC_F0) { |
291 | result = wlp_parse_f0(wlp, skb); | 275 | result = wlp_parse_f0(wlp, skb); |
@@ -337,10 +321,9 @@ int wlp_enroll_neighbor(struct wlp *wlp, struct wlp_neighbor_e *neighbor, | |||
337 | struct device *dev = &wlp->rc->uwb_dev.dev; | 321 | struct device *dev = &wlp->rc->uwb_dev.dev; |
338 | char buf[WLP_WSS_UUID_STRSIZE]; | 322 | char buf[WLP_WSS_UUID_STRSIZE]; |
339 | struct uwb_dev_addr *dev_addr = &neighbor->uwb_dev->dev_addr; | 323 | struct uwb_dev_addr *dev_addr = &neighbor->uwb_dev->dev_addr; |
324 | |||
340 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); | 325 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
341 | d_fnstart(6, dev, "wlp %p, neighbor %p, wss %p, wssid %p (%s)\n", | 326 | |
342 | wlp, neighbor, wss, wssid, buf); | ||
343 | d_printf(6, dev, "Complete me.\n"); | ||
344 | result = wlp_d1d2_exchange(wlp, neighbor, wss, wssid); | 327 | result = wlp_d1d2_exchange(wlp, neighbor, wss, wssid); |
345 | if (result < 0) { | 328 | if (result < 0) { |
346 | dev_err(dev, "WLP: D1/D2 message exchange for enrollment " | 329 | dev_err(dev, "WLP: D1/D2 message exchange for enrollment " |
@@ -360,13 +343,10 @@ int wlp_enroll_neighbor(struct wlp *wlp, struct wlp_neighbor_e *neighbor, | |||
360 | goto error; | 343 | goto error; |
361 | } else { | 344 | } else { |
362 | wss->state = WLP_WSS_STATE_ENROLLED; | 345 | wss->state = WLP_WSS_STATE_ENROLLED; |
363 | d_printf(2, dev, "WLP: Success Enrollment into unsecure WSS " | 346 | dev_dbg(dev, "WLP: Success Enrollment into unsecure WSS " |
364 | "%s using neighbor %02x:%02x. \n", buf, | 347 | "%s using neighbor %02x:%02x. \n", |
365 | dev_addr->data[1], dev_addr->data[0]); | 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 | out: | 350 | out: |
371 | return result; | 351 | return result; |
372 | error: | 352 | error: |
@@ -449,7 +429,6 @@ ssize_t wlp_discover(struct wlp *wlp) | |||
449 | int result = 0; | 429 | int result = 0; |
450 | struct device *dev = &wlp->rc->uwb_dev.dev; | 430 | struct device *dev = &wlp->rc->uwb_dev.dev; |
451 | 431 | ||
452 | d_fnstart(6, dev, "wlp %p \n", wlp); | ||
453 | mutex_lock(&wlp->nbmutex); | 432 | mutex_lock(&wlp->nbmutex); |
454 | /* Clear current neighborhood cache. */ | 433 | /* Clear current neighborhood cache. */ |
455 | __wlp_neighbors_release(wlp); | 434 | __wlp_neighbors_release(wlp); |
@@ -469,7 +448,6 @@ ssize_t wlp_discover(struct wlp *wlp) | |||
469 | } | 448 | } |
470 | error_dev_for_each: | 449 | error_dev_for_each: |
471 | mutex_unlock(&wlp->nbmutex); | 450 | mutex_unlock(&wlp->nbmutex); |
472 | d_fnend(6, dev, "wlp %p \n", wlp); | ||
473 | return result; | 451 | return result; |
474 | } | 452 | } |
475 | 453 | ||
@@ -492,9 +470,6 @@ void wlp_uwb_notifs_cb(void *_wlp, struct uwb_dev *uwb_dev, | |||
492 | int result; | 470 | int result; |
493 | switch (event) { | 471 | switch (event) { |
494 | case UWB_NOTIF_ONAIR: | 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 | result = wlp_eda_create_node(&wlp->eda, | 473 | result = wlp_eda_create_node(&wlp->eda, |
499 | uwb_dev->mac_addr.data, | 474 | uwb_dev->mac_addr.data, |
500 | &uwb_dev->dev_addr); | 475 | &uwb_dev->dev_addr); |
@@ -505,18 +480,11 @@ void wlp_uwb_notifs_cb(void *_wlp, struct uwb_dev *uwb_dev, | |||
505 | uwb_dev->dev_addr.data[0]); | 480 | uwb_dev->dev_addr.data[0]); |
506 | break; | 481 | break; |
507 | case UWB_NOTIF_OFFAIR: | 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 | wlp_eda_rm_node(&wlp->eda, &uwb_dev->dev_addr); | 483 | wlp_eda_rm_node(&wlp->eda, &uwb_dev->dev_addr); |
512 | mutex_lock(&wlp->nbmutex); | 484 | mutex_lock(&wlp->nbmutex); |
513 | list_for_each_entry_safe(neighbor, next, &wlp->neighbors, | 485 | list_for_each_entry_safe(neighbor, next, &wlp->neighbors, node) { |
514 | node) { | 486 | if (neighbor->uwb_dev == uwb_dev) |
515 | if (neighbor->uwb_dev == uwb_dev) { | ||
516 | d_printf(6, dev, "Removing device from " | ||
517 | "neighborhood.\n"); | ||
518 | __wlp_neighbor_release(neighbor); | 487 | __wlp_neighbor_release(neighbor); |
519 | } | ||
520 | } | 488 | } |
521 | mutex_unlock(&wlp->nbmutex); | 489 | mutex_unlock(&wlp->nbmutex); |
522 | break; | 490 | break; |
@@ -538,14 +506,13 @@ static void wlp_channel_changed(struct uwb_pal *pal, int channel) | |||
538 | 506 | ||
539 | int wlp_setup(struct wlp *wlp, struct uwb_rc *rc, struct net_device *ndev) | 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 | int result; | 509 | int result; |
543 | 510 | ||
544 | d_fnstart(6, dev, "wlp %p\n", wlp); | ||
545 | BUG_ON(wlp->fill_device_info == NULL); | 511 | BUG_ON(wlp->fill_device_info == NULL); |
546 | BUG_ON(wlp->xmit_frame == NULL); | 512 | BUG_ON(wlp->xmit_frame == NULL); |
547 | BUG_ON(wlp->stop_queue == NULL); | 513 | BUG_ON(wlp->stop_queue == NULL); |
548 | BUG_ON(wlp->start_queue == NULL); | 514 | BUG_ON(wlp->start_queue == NULL); |
515 | |||
549 | wlp->rc = rc; | 516 | wlp->rc = rc; |
550 | wlp->ndev = ndev; | 517 | wlp->ndev = ndev; |
551 | wlp_eda_init(&wlp->eda);/* Set up address cache */ | 518 | wlp_eda_init(&wlp->eda);/* Set up address cache */ |
@@ -560,15 +527,12 @@ int wlp_setup(struct wlp *wlp, struct uwb_rc *rc, struct net_device *ndev) | |||
560 | if (result < 0) | 527 | if (result < 0) |
561 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); | 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 | return result; | 530 | return result; |
565 | } | 531 | } |
566 | EXPORT_SYMBOL_GPL(wlp_setup); | 532 | EXPORT_SYMBOL_GPL(wlp_setup); |
567 | 533 | ||
568 | void wlp_remove(struct wlp *wlp) | 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 | wlp_neighbors_release(wlp); | 536 | wlp_neighbors_release(wlp); |
573 | uwb_pal_unregister(&wlp->pal); | 537 | uwb_pal_unregister(&wlp->pal); |
574 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); | 538 | uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler); |
@@ -578,9 +542,6 @@ void wlp_remove(struct wlp *wlp) | |||
578 | kfree(wlp->dev_info); | 542 | kfree(wlp->dev_info); |
579 | mutex_unlock(&wlp->mutex); | 543 | mutex_unlock(&wlp->mutex); |
580 | wlp->rc = NULL; | 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 | EXPORT_SYMBOL_GPL(wlp_remove); | 546 | EXPORT_SYMBOL_GPL(wlp_remove); |
586 | 547 | ||
diff --git a/drivers/uwb/wlp/wss-lc.c b/drivers/uwb/wlp/wss-lc.c index 96b18c9bd6e9..5913c7a5d922 100644 --- a/drivers/uwb/wlp/wss-lc.c +++ b/drivers/uwb/wlp/wss-lc.c | |||
@@ -43,14 +43,11 @@ | |||
43 | * wlp_wss_release() | 43 | * wlp_wss_release() |
44 | * wlp_wss_reset() | 44 | * wlp_wss_reset() |
45 | */ | 45 | */ |
46 | |||
47 | #include <linux/etherdevice.h> /* for is_valid_ether_addr */ | 46 | #include <linux/etherdevice.h> /* for is_valid_ether_addr */ |
48 | #include <linux/skbuff.h> | 47 | #include <linux/skbuff.h> |
49 | #include <linux/wlp.h> | 48 | #include <linux/wlp.h> |
50 | #define D_LOCAL 5 | ||
51 | #include <linux/uwb/debug.h> | ||
52 | #include "wlp-internal.h" | ||
53 | 49 | ||
50 | #include "wlp-internal.h" | ||
54 | 51 | ||
55 | size_t wlp_wss_key_print(char *buf, size_t bufsize, u8 *key) | 52 | size_t wlp_wss_key_print(char *buf, size_t bufsize, u8 *key) |
56 | { | 53 | { |
@@ -116,9 +113,6 @@ struct uwb_mac_addr wlp_wss_sel_bcast_addr(struct wlp_wss *wss) | |||
116 | */ | 113 | */ |
117 | void wlp_wss_reset(struct wlp_wss *wss) | 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 | memset(&wss->wssid, 0, sizeof(wss->wssid)); | 116 | memset(&wss->wssid, 0, sizeof(wss->wssid)); |
123 | wss->hash = 0; | 117 | wss->hash = 0; |
124 | memset(&wss->name[0], 0, sizeof(wss->name)); | 118 | memset(&wss->name[0], 0, sizeof(wss->name)); |
@@ -127,7 +121,6 @@ void wlp_wss_reset(struct wlp_wss *wss) | |||
127 | memset(&wss->master_key[0], 0, sizeof(wss->master_key)); | 121 | memset(&wss->master_key[0], 0, sizeof(wss->master_key)); |
128 | wss->tag = 0; | 122 | wss->tag = 0; |
129 | wss->state = WLP_WSS_STATE_NONE; | 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 @@ int wlp_wss_sysfs_add(struct wlp_wss *wss, char *wssid_str) | |||
145 | struct device *dev = &wlp->rc->uwb_dev.dev; | 138 | struct device *dev = &wlp->rc->uwb_dev.dev; |
146 | int result; | 139 | int result; |
147 | 140 | ||
148 | d_fnstart(5, dev, "wss (%p), wssid: %s\n", wss, wssid_str); | ||
149 | result = kobject_set_name(&wss->kobj, "wss-%s", wssid_str); | 141 | result = kobject_set_name(&wss->kobj, "wss-%s", wssid_str); |
150 | if (result < 0) | 142 | if (result < 0) |
151 | return result; | 143 | return result; |
@@ -162,7 +154,6 @@ int wlp_wss_sysfs_add(struct wlp_wss *wss, char *wssid_str) | |||
162 | result); | 154 | result); |
163 | goto error_sysfs_create_group; | 155 | goto error_sysfs_create_group; |
164 | } | 156 | } |
165 | d_fnend(5, dev, "Completed. result = %d \n", result); | ||
166 | return 0; | 157 | return 0; |
167 | error_sysfs_create_group: | 158 | error_sysfs_create_group: |
168 | 159 | ||
@@ -214,22 +205,14 @@ int wlp_wss_enroll_target(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
214 | struct wlp *wlp = container_of(wss, struct wlp, wss); | 205 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
215 | struct device *dev = &wlp->rc->uwb_dev.dev; | 206 | struct device *dev = &wlp->rc->uwb_dev.dev; |
216 | struct wlp_neighbor_e *neighbor; | 207 | struct wlp_neighbor_e *neighbor; |
217 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
218 | int result = -ENXIO; | 208 | int result = -ENXIO; |
219 | struct uwb_dev_addr *dev_addr; | 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 | mutex_lock(&wlp->nbmutex); | 211 | mutex_lock(&wlp->nbmutex); |
225 | list_for_each_entry(neighbor, &wlp->neighbors, node) { | 212 | list_for_each_entry(neighbor, &wlp->neighbors, node) { |
226 | dev_addr = &neighbor->uwb_dev->dev_addr; | 213 | dev_addr = &neighbor->uwb_dev->dev_addr; |
227 | if (!memcmp(dest, dev_addr, sizeof(*dest))) { | 214 | if (!memcmp(dest, dev_addr, sizeof(*dest))) { |
228 | d_printf(5, dev, "Neighbor %02x:%02x is valid, " | 215 | result = wlp_enroll_neighbor(wlp, neighbor, wss, wssid); |
229 | "enrolling. \n", | ||
230 | dev_addr->data[1], dev_addr->data[0]); | ||
231 | result = wlp_enroll_neighbor(wlp, neighbor, wss, | ||
232 | wssid); | ||
233 | break; | 216 | break; |
234 | } | 217 | } |
235 | } | 218 | } |
@@ -237,8 +220,6 @@ int wlp_wss_enroll_target(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
237 | dev_err(dev, "WLP: Cannot find neighbor %02x:%02x. \n", | 220 | dev_err(dev, "WLP: Cannot find neighbor %02x:%02x. \n", |
238 | dest->data[1], dest->data[0]); | 221 | dest->data[1], dest->data[0]); |
239 | mutex_unlock(&wlp->nbmutex); | 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 | return result; | 223 | return result; |
243 | } | 224 | } |
244 | 225 | ||
@@ -260,16 +241,11 @@ int wlp_wss_enroll_discovered(struct wlp_wss *wss, struct wlp_uuid *wssid) | |||
260 | char buf[WLP_WSS_UUID_STRSIZE]; | 241 | char buf[WLP_WSS_UUID_STRSIZE]; |
261 | int result = -ENXIO; | 242 | int result = -ENXIO; |
262 | 243 | ||
263 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); | 244 | |
264 | d_fnstart(5, dev, "wss %p, wssid %s \n", wss, buf); | ||
265 | mutex_lock(&wlp->nbmutex); | 245 | mutex_lock(&wlp->nbmutex); |
266 | list_for_each_entry(neighbor, &wlp->neighbors, node) { | 246 | list_for_each_entry(neighbor, &wlp->neighbors, node) { |
267 | list_for_each_entry(wssid_e, &neighbor->wssid, node) { | 247 | list_for_each_entry(wssid_e, &neighbor->wssid, node) { |
268 | if (!memcmp(wssid, &wssid_e->wssid, sizeof(*wssid))) { | 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 | result = wlp_enroll_neighbor(wlp, neighbor, | 249 | result = wlp_enroll_neighbor(wlp, neighbor, |
274 | wss, wssid); | 250 | wss, wssid); |
275 | if (result == 0) /* enrollment success */ | 251 | if (result == 0) /* enrollment success */ |
@@ -279,10 +255,11 @@ int wlp_wss_enroll_discovered(struct wlp_wss *wss, struct wlp_uuid *wssid) | |||
279 | } | 255 | } |
280 | } | 256 | } |
281 | out: | 257 | out: |
282 | if (result == -ENXIO) | 258 | if (result == -ENXIO) { |
259 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); | ||
283 | dev_err(dev, "WLP: Cannot find WSSID %s in cache. \n", buf); | 260 | dev_err(dev, "WLP: Cannot find WSSID %s in cache. \n", buf); |
261 | } | ||
284 | mutex_unlock(&wlp->nbmutex); | 262 | mutex_unlock(&wlp->nbmutex); |
285 | d_fnend(5, dev, "wss %p, wssid %s, result %d \n", wss, buf, result); | ||
286 | return result; | 263 | return result; |
287 | } | 264 | } |
288 | 265 | ||
@@ -307,27 +284,22 @@ int wlp_wss_enroll(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
307 | struct uwb_dev_addr bcast = {.data = {0xff, 0xff} }; | 284 | struct uwb_dev_addr bcast = {.data = {0xff, 0xff} }; |
308 | 285 | ||
309 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); | 286 | wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
287 | |||
310 | if (wss->state != WLP_WSS_STATE_NONE) { | 288 | if (wss->state != WLP_WSS_STATE_NONE) { |
311 | dev_err(dev, "WLP: Already enrolled in WSS %s.\n", buf); | 289 | dev_err(dev, "WLP: Already enrolled in WSS %s.\n", buf); |
312 | result = -EEXIST; | 290 | result = -EEXIST; |
313 | goto error; | 291 | goto error; |
314 | } | 292 | } |
315 | if (!memcmp(&bcast, devaddr, sizeof(bcast))) { | 293 | if (!memcmp(&bcast, devaddr, sizeof(bcast))) |
316 | d_printf(5, dev, "Request to enroll in discovered WSS " | ||
317 | "with WSSID %s \n", buf); | ||
318 | result = wlp_wss_enroll_discovered(wss, wssid); | 294 | result = wlp_wss_enroll_discovered(wss, wssid); |
319 | } else { | 295 | 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]); | ||
323 | result = wlp_wss_enroll_target(wss, wssid, devaddr); | 296 | result = wlp_wss_enroll_target(wss, wssid, devaddr); |
324 | } | ||
325 | if (result < 0) { | 297 | if (result < 0) { |
326 | dev_err(dev, "WLP: Unable to enroll into WSS %s, result %d \n", | 298 | dev_err(dev, "WLP: Unable to enroll into WSS %s, result %d \n", |
327 | buf, result); | 299 | buf, result); |
328 | goto error; | 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 | result = wlp_wss_sysfs_add(wss, buf); | 303 | result = wlp_wss_sysfs_add(wss, buf); |
332 | if (result < 0) { | 304 | if (result < 0) { |
333 | dev_err(dev, "WLP: Unable to set up sysfs for WSS kobject.\n"); | 305 | dev_err(dev, "WLP: Unable to set up sysfs for WSS kobject.\n"); |
@@ -363,7 +335,6 @@ int wlp_wss_activate(struct wlp_wss *wss) | |||
363 | u8 hash; /* only include one hash */ | 335 | u8 hash; /* only include one hash */ |
364 | } ie_data; | 336 | } ie_data; |
365 | 337 | ||
366 | d_fnstart(5, dev, "Activating WSS %p. \n", wss); | ||
367 | BUG_ON(wss->state != WLP_WSS_STATE_ENROLLED); | 338 | BUG_ON(wss->state != WLP_WSS_STATE_ENROLLED); |
368 | wss->hash = wlp_wss_comp_wssid_hash(&wss->wssid); | 339 | wss->hash = wlp_wss_comp_wssid_hash(&wss->wssid); |
369 | wss->tag = wss->hash; | 340 | wss->tag = wss->hash; |
@@ -382,7 +353,6 @@ int wlp_wss_activate(struct wlp_wss *wss) | |||
382 | wss->state = WLP_WSS_STATE_ACTIVE; | 353 | wss->state = WLP_WSS_STATE_ACTIVE; |
383 | result = 0; | 354 | result = 0; |
384 | error_wlp_ie: | 355 | error_wlp_ie: |
385 | d_fnend(5, dev, "Activating WSS %p, result = %d \n", wss, result); | ||
386 | return result; | 356 | return result; |
387 | } | 357 | } |
388 | 358 | ||
@@ -405,7 +375,6 @@ int wlp_wss_enroll_activate(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
405 | int result = 0; | 375 | int result = 0; |
406 | char buf[WLP_WSS_UUID_STRSIZE]; | 376 | char buf[WLP_WSS_UUID_STRSIZE]; |
407 | 377 | ||
408 | d_fnstart(5, dev, "Enrollment and activation requested. \n"); | ||
409 | mutex_lock(&wss->mutex); | 378 | mutex_lock(&wss->mutex); |
410 | result = wlp_wss_enroll(wss, wssid, devaddr); | 379 | result = wlp_wss_enroll(wss, wssid, devaddr); |
411 | if (result < 0) { | 380 | if (result < 0) { |
@@ -424,7 +393,6 @@ int wlp_wss_enroll_activate(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
424 | error_activate: | 393 | error_activate: |
425 | error_enroll: | 394 | error_enroll: |
426 | mutex_unlock(&wss->mutex); | 395 | mutex_unlock(&wss->mutex); |
427 | d_fnend(5, dev, "Completed. result = %d \n", result); | ||
428 | return result; | 396 | return result; |
429 | } | 397 | } |
430 | 398 | ||
@@ -447,11 +415,9 @@ int wlp_wss_create_activate(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
447 | struct device *dev = &wlp->rc->uwb_dev.dev; | 415 | struct device *dev = &wlp->rc->uwb_dev.dev; |
448 | int result = 0; | 416 | int result = 0; |
449 | char buf[WLP_WSS_UUID_STRSIZE]; | 417 | char buf[WLP_WSS_UUID_STRSIZE]; |
450 | d_fnstart(5, dev, "Request to create new WSS.\n"); | 418 | |
451 | result = wlp_wss_uuid_print(buf, sizeof(buf), wssid); | 419 | result = wlp_wss_uuid_print(buf, sizeof(buf), wssid); |
452 | d_printf(5, dev, "Request to create WSS: WSSID=%s, name=%s, " | 420 | |
453 | "sec_status=%u, accepting enrollment=%u \n", | ||
454 | buf, name, sec_status, accept); | ||
455 | if (!mutex_trylock(&wss->mutex)) { | 421 | if (!mutex_trylock(&wss->mutex)) { |
456 | dev_err(dev, "WLP: WLP association session in progress.\n"); | 422 | dev_err(dev, "WLP: WLP association session in progress.\n"); |
457 | return -EBUSY; | 423 | return -EBUSY; |
@@ -498,7 +464,6 @@ int wlp_wss_create_activate(struct wlp_wss *wss, struct wlp_uuid *wssid, | |||
498 | result = 0; | 464 | result = 0; |
499 | out: | 465 | out: |
500 | mutex_unlock(&wss->mutex); | 466 | mutex_unlock(&wss->mutex); |
501 | d_fnend(5, dev, "Completed. result = %d \n", result); | ||
502 | return result; | 467 | return result; |
503 | } | 468 | } |
504 | 469 | ||
@@ -520,16 +485,12 @@ int wlp_wss_is_active(struct wlp *wlp, struct wlp_wss *wss, | |||
520 | { | 485 | { |
521 | int result = 0; | 486 | int result = 0; |
522 | struct device *dev = &wlp->rc->uwb_dev.dev; | 487 | struct device *dev = &wlp->rc->uwb_dev.dev; |
523 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
524 | DECLARE_COMPLETION_ONSTACK(completion); | 488 | DECLARE_COMPLETION_ONSTACK(completion); |
525 | struct wlp_session session; | 489 | struct wlp_session session; |
526 | struct sk_buff *skb; | 490 | struct sk_buff *skb; |
527 | struct wlp_frame_assoc *resp; | 491 | struct wlp_frame_assoc *resp; |
528 | struct wlp_uuid wssid; | 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 | mutex_lock(&wlp->mutex); | 494 | mutex_lock(&wlp->mutex); |
534 | /* Send C1 association frame */ | 495 | /* Send C1 association frame */ |
535 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C1); | 496 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C1); |
@@ -565,8 +526,6 @@ int wlp_wss_is_active(struct wlp *wlp, struct wlp_wss *wss, | |||
565 | /* Parse message in session->data: it will be either C2 or F0 */ | 526 | /* Parse message in session->data: it will be either C2 or F0 */ |
566 | skb = session.data; | 527 | skb = session.data; |
567 | resp = (void *) skb->data; | 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 | if (resp->type == WLP_ASSOC_F0) { | 529 | if (resp->type == WLP_ASSOC_F0) { |
571 | result = wlp_parse_f0(wlp, skb); | 530 | result = wlp_parse_f0(wlp, skb); |
572 | if (result < 0) | 531 | if (result < 0) |
@@ -584,11 +543,9 @@ int wlp_wss_is_active(struct wlp *wlp, struct wlp_wss *wss, | |||
584 | result = 0; | 543 | result = 0; |
585 | goto error_resp_parse; | 544 | goto error_resp_parse; |
586 | } | 545 | } |
587 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid))) { | 546 | if (!memcmp(&wssid, &wss->wssid, sizeof(wssid))) |
588 | d_printf(5, dev, "WSSID in C2 frame matches local " | ||
589 | "active WSS.\n"); | ||
590 | result = 1; | 547 | result = 1; |
591 | } else { | 548 | else { |
592 | dev_err(dev, "WLP: Received a C2 frame without matching " | 549 | dev_err(dev, "WLP: Received a C2 frame without matching " |
593 | "WSSID.\n"); | 550 | "WSSID.\n"); |
594 | result = 0; | 551 | result = 0; |
@@ -598,8 +555,6 @@ error_resp_parse: | |||
598 | out: | 555 | out: |
599 | wlp->session = NULL; | 556 | wlp->session = NULL; |
600 | mutex_unlock(&wlp->mutex); | 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 | return result; | 558 | return result; |
604 | } | 559 | } |
605 | 560 | ||
@@ -620,16 +575,8 @@ int wlp_wss_activate_connection(struct wlp *wlp, struct wlp_wss *wss, | |||
620 | { | 575 | { |
621 | struct device *dev = &wlp->rc->uwb_dev.dev; | 576 | struct device *dev = &wlp->rc->uwb_dev.dev; |
622 | int result = 0; | 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 | if (!memcmp(wssid, &wss->wssid, sizeof(*wssid))) { | 579 | if (!memcmp(wssid, &wss->wssid, sizeof(*wssid))) { |
631 | d_printf(5, dev, "WSSID from neighbor frame matches local " | ||
632 | "active WSS.\n"); | ||
633 | /* Update EDA cache */ | 580 | /* Update EDA cache */ |
634 | result = wlp_eda_update_node(&wlp->eda, dev_addr, wss, | 581 | result = wlp_eda_update_node(&wlp->eda, dev_addr, wss, |
635 | (void *) virt_addr->data, *tag, | 582 | (void *) virt_addr->data, *tag, |
@@ -638,18 +585,9 @@ int wlp_wss_activate_connection(struct wlp *wlp, struct wlp_wss *wss, | |||
638 | dev_err(dev, "WLP: Unable to update EDA cache " | 585 | dev_err(dev, "WLP: Unable to update EDA cache " |
639 | "with new connected neighbor information.\n"); | 586 | "with new connected neighbor information.\n"); |
640 | } else { | 587 | } else { |
641 | dev_err(dev, "WLP: Neighbor does not have matching " | 588 | dev_err(dev, "WLP: Neighbor does not have matching WSSID.\n"); |
642 | "WSSID.\n"); | ||
643 | result = -EINVAL; | 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 | return result; | 591 | return result; |
654 | } | 592 | } |
655 | 593 | ||
@@ -665,7 +603,6 @@ int wlp_wss_connect_neighbor(struct wlp *wlp, struct wlp_wss *wss, | |||
665 | { | 603 | { |
666 | int result; | 604 | int result; |
667 | struct device *dev = &wlp->rc->uwb_dev.dev; | 605 | struct device *dev = &wlp->rc->uwb_dev.dev; |
668 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
669 | struct wlp_uuid wssid; | 606 | struct wlp_uuid wssid; |
670 | u8 tag; | 607 | u8 tag; |
671 | struct uwb_mac_addr virt_addr; | 608 | struct uwb_mac_addr virt_addr; |
@@ -674,9 +611,6 @@ int wlp_wss_connect_neighbor(struct wlp *wlp, struct wlp_wss *wss, | |||
674 | struct wlp_frame_assoc *resp; | 611 | struct wlp_frame_assoc *resp; |
675 | struct sk_buff *skb; | 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 | mutex_lock(&wlp->mutex); | 614 | mutex_lock(&wlp->mutex); |
681 | /* Send C3 association frame */ | 615 | /* Send C3 association frame */ |
682 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C3); | 616 | result = wlp_send_assoc_frame(wlp, wss, dev_addr, WLP_ASSOC_C3); |
@@ -711,8 +645,6 @@ int wlp_wss_connect_neighbor(struct wlp *wlp, struct wlp_wss *wss, | |||
711 | /* Parse message in session->data: it will be either C4 or F0 */ | 645 | /* Parse message in session->data: it will be either C4 or F0 */ |
712 | skb = session.data; | 646 | skb = session.data; |
713 | resp = (void *) skb->data; | 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 | if (resp->type == WLP_ASSOC_F0) { | 648 | if (resp->type == WLP_ASSOC_F0) { |
717 | result = wlp_parse_f0(wlp, skb); | 649 | result = wlp_parse_f0(wlp, skb); |
718 | if (result < 0) | 650 | if (result < 0) |
@@ -744,8 +676,6 @@ out: | |||
744 | WLP_WSS_CONNECT_FAILED); | 676 | WLP_WSS_CONNECT_FAILED); |
745 | wlp->session = NULL; | 677 | wlp->session = NULL; |
746 | mutex_unlock(&wlp->mutex); | 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 | return result; | 679 | return result; |
750 | } | 680 | } |
751 | 681 | ||
@@ -780,12 +710,8 @@ void wlp_wss_connect_send(struct work_struct *ws) | |||
780 | struct wlp_wss *wss = &wlp->wss; | 710 | struct wlp_wss *wss = &wlp->wss; |
781 | int result; | 711 | int result; |
782 | struct device *dev = &wlp->rc->uwb_dev.dev; | 712 | struct device *dev = &wlp->rc->uwb_dev.dev; |
783 | char buf[WLP_WSS_UUID_STRSIZE]; | ||
784 | 713 | ||
785 | mutex_lock(&wss->mutex); | 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 | if (wss->state < WLP_WSS_STATE_ACTIVE) { | 715 | if (wss->state < WLP_WSS_STATE_ACTIVE) { |
790 | if (printk_ratelimit()) | 716 | if (printk_ratelimit()) |
791 | dev_err(dev, "WLP: Attempting to connect with " | 717 | dev_err(dev, "WLP: Attempting to connect with " |
@@ -836,7 +762,6 @@ out: | |||
836 | BUG_ON(wlp->start_queue == NULL); | 762 | BUG_ON(wlp->start_queue == NULL); |
837 | wlp->start_queue(wlp); | 763 | wlp->start_queue(wlp); |
838 | mutex_unlock(&wss->mutex); | 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 @@ int wlp_wss_prep_hdr(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
855 | struct sk_buff *skb = _skb; | 780 | struct sk_buff *skb = _skb; |
856 | struct wlp_frame_std_abbrv_hdr *std_hdr; | 781 | struct wlp_frame_std_abbrv_hdr *std_hdr; |
857 | 782 | ||
858 | d_fnstart(6, dev, "wlp %p \n", wlp); | ||
859 | if (eda_entry->state == WLP_WSS_CONNECTED) { | 783 | if (eda_entry->state == WLP_WSS_CONNECTED) { |
860 | /* Add WLP header */ | 784 | /* Add WLP header */ |
861 | BUG_ON(skb_headroom(skb) < sizeof(*std_hdr)); | 785 | BUG_ON(skb_headroom(skb) < sizeof(*std_hdr)); |
@@ -873,7 +797,6 @@ int wlp_wss_prep_hdr(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
873 | dev_addr->data[0]); | 797 | dev_addr->data[0]); |
874 | result = -EINVAL; | 798 | result = -EINVAL; |
875 | } | 799 | } |
876 | d_fnend(6, dev, "wlp %p \n", wlp); | ||
877 | return result; | 800 | return result; |
878 | } | 801 | } |
879 | 802 | ||
@@ -893,16 +816,9 @@ int wlp_wss_connect_prep(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
893 | { | 816 | { |
894 | int result = 0; | 817 | int result = 0; |
895 | struct device *dev = &wlp->rc->uwb_dev.dev; | 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 | struct sk_buff *skb = _skb; | 819 | struct sk_buff *skb = _skb; |
899 | struct wlp_assoc_conn_ctx *conn_ctx; | 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 | if (eda_entry->state == WLP_WSS_UNCONNECTED) { | 822 | if (eda_entry->state == WLP_WSS_UNCONNECTED) { |
907 | /* We don't want any more packets while we set up connection */ | 823 | /* We don't want any more packets while we set up connection */ |
908 | BUG_ON(wlp->stop_queue == NULL); | 824 | BUG_ON(wlp->stop_queue == NULL); |
@@ -929,12 +845,9 @@ int wlp_wss_connect_prep(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
929 | "previously. Not retrying. \n"); | 845 | "previously. Not retrying. \n"); |
930 | result = -ENONET; | 846 | result = -ENONET; |
931 | goto out; | 847 | goto out; |
932 | } else { /* eda_entry->state == WLP_WSS_CONNECTED */ | 848 | } else /* eda_entry->state == WLP_WSS_CONNECTED */ |
933 | d_printf(5, dev, "Neighbor is connected, preparing frame.\n"); | ||
934 | result = wlp_wss_prep_hdr(wlp, eda_entry, skb); | 849 | result = wlp_wss_prep_hdr(wlp, eda_entry, skb); |
935 | } | ||
936 | out: | 850 | out: |
937 | d_fnend(5, dev, "wlp %p, result = %d \n", wlp, result); | ||
938 | return result; | 851 | return result; |
939 | } | 852 | } |
940 | 853 | ||
@@ -957,8 +870,6 @@ int wlp_wss_send_copy(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
957 | struct sk_buff *copy; | 870 | struct sk_buff *copy; |
958 | struct uwb_dev_addr *dev_addr = &eda_entry->dev_addr; | 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 | copy = skb_copy(skb, GFP_ATOMIC); | 873 | copy = skb_copy(skb, GFP_ATOMIC); |
963 | if (copy == NULL) { | 874 | if (copy == NULL) { |
964 | if (printk_ratelimit()) | 875 | if (printk_ratelimit()) |
@@ -988,8 +899,6 @@ int wlp_wss_send_copy(struct wlp *wlp, struct wlp_eda_node *eda_entry, | |||
988 | dev_kfree_skb_irq(copy);/*we need to free if tx fails */ | 899 | dev_kfree_skb_irq(copy);/*we need to free if tx fails */ |
989 | } | 900 | } |
990 | out: | 901 | out: |
991 | d_fnend(5, dev, "to neighbor %02x:%02x \n", dev_addr->data[1], | ||
992 | dev_addr->data[0]); | ||
993 | return result; | 902 | return result; |
994 | } | 903 | } |
995 | 904 | ||
@@ -1005,7 +914,7 @@ int wlp_wss_setup(struct net_device *net_dev, struct wlp_wss *wss) | |||
1005 | struct wlp *wlp = container_of(wss, struct wlp, wss); | 914 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
1006 | struct device *dev = &wlp->rc->uwb_dev.dev; | 915 | struct device *dev = &wlp->rc->uwb_dev.dev; |
1007 | int result = 0; | 916 | int result = 0; |
1008 | d_fnstart(5, dev, "wss (%p) \n", wss); | 917 | |
1009 | mutex_lock(&wss->mutex); | 918 | mutex_lock(&wss->mutex); |
1010 | wss->kobj.parent = &net_dev->dev.kobj; | 919 | wss->kobj.parent = &net_dev->dev.kobj; |
1011 | if (!is_valid_ether_addr(net_dev->dev_addr)) { | 920 | if (!is_valid_ether_addr(net_dev->dev_addr)) { |
@@ -1018,7 +927,6 @@ int wlp_wss_setup(struct net_device *net_dev, struct wlp_wss *wss) | |||
1018 | sizeof(wss->virtual_addr.data)); | 927 | sizeof(wss->virtual_addr.data)); |
1019 | out: | 928 | out: |
1020 | mutex_unlock(&wss->mutex); | 929 | mutex_unlock(&wss->mutex); |
1021 | d_fnend(5, dev, "wss (%p) \n", wss); | ||
1022 | return result; | 930 | return result; |
1023 | } | 931 | } |
1024 | EXPORT_SYMBOL_GPL(wlp_wss_setup); | 932 | EXPORT_SYMBOL_GPL(wlp_wss_setup); |
@@ -1035,8 +943,7 @@ EXPORT_SYMBOL_GPL(wlp_wss_setup); | |||
1035 | void wlp_wss_remove(struct wlp_wss *wss) | 943 | void wlp_wss_remove(struct wlp_wss *wss) |
1036 | { | 944 | { |
1037 | struct wlp *wlp = container_of(wss, struct wlp, wss); | 945 | struct wlp *wlp = container_of(wss, struct wlp, wss); |
1038 | struct device *dev = &wlp->rc->uwb_dev.dev; | 946 | |
1039 | d_fnstart(5, dev, "wss (%p) \n", wss); | ||
1040 | mutex_lock(&wss->mutex); | 947 | mutex_lock(&wss->mutex); |
1041 | if (wss->state == WLP_WSS_STATE_ACTIVE) | 948 | if (wss->state == WLP_WSS_STATE_ACTIVE) |
1042 | uwb_rc_ie_rm(wlp->rc, UWB_IE_WLP); | 949 | uwb_rc_ie_rm(wlp->rc, UWB_IE_WLP); |
@@ -1050,6 +957,5 @@ void wlp_wss_remove(struct wlp_wss *wss) | |||
1050 | wlp_eda_release(&wlp->eda); | 957 | wlp_eda_release(&wlp->eda); |
1051 | wlp_eda_init(&wlp->eda); | 958 | wlp_eda_init(&wlp->eda); |
1052 | mutex_unlock(&wss->mutex); | 959 | mutex_unlock(&wss->mutex); |
1053 | d_fnend(5, dev, "wss (%p) \n", wss); | ||
1054 | } | 960 | } |
1055 | EXPORT_SYMBOL_GPL(wlp_wss_remove); | 961 | EXPORT_SYMBOL_GPL(wlp_wss_remove); |