diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-10-27 12:48:09 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-10-28 08:09:17 -0400 |
commit | 1cde7f68ced8d10a20dd2370e9d1d22ab3c1ea5c (patch) | |
tree | 2fb65bbb93eae73e02fa1e9608212536259f8802 /drivers/uwb/beacon.c | |
parent | 4d2bea4ca0adb4cebfbf89d34869c74081c42577 (diff) |
uwb: order IEs by element ID
ECMA-368 requires that IEs in a beacon must be sorted by element ID. Most
hardware uses the ordering in the Set IE URC command so get the ordering
right on the host.
Also refactor the IE management code:
- use uwb_ie_next() instead of uwb_ie_for_each().
- remove unnecessary functions.
- API is now only uwb_rc_ie_add() and uwb_rc_ie_rm().
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/uwb/beacon.c')
-rw-r--r-- | drivers/uwb/beacon.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/uwb/beacon.c b/drivers/uwb/beacon.c index 46b18eec5026..ad823987cede 100644 --- a/drivers/uwb/beacon.c +++ b/drivers/uwb/beacon.c | |||
@@ -349,22 +349,22 @@ ssize_t uwb_bce_print_IEs(struct uwb_dev *uwb_dev, struct uwb_beca_e *bce, | |||
349 | ssize_t result = 0; | 349 | ssize_t result = 0; |
350 | struct uwb_rc_evt_beacon *be; | 350 | struct uwb_rc_evt_beacon *be; |
351 | struct uwb_beacon_frame *bf; | 351 | struct uwb_beacon_frame *bf; |
352 | struct uwb_buf_ctx ctx = { | 352 | int ies_len; |
353 | .buf = buf, | 353 | struct uwb_ie_hdr *ies; |
354 | .bytes = 0, | ||
355 | .size = size | ||
356 | }; | ||
357 | 354 | ||
358 | mutex_lock(&bce->mutex); | 355 | mutex_lock(&bce->mutex); |
356 | |||
359 | be = bce->be; | 357 | be = bce->be; |
360 | if (be == NULL) | 358 | if (be) { |
361 | goto out; | 359 | bf = (struct uwb_beacon_frame *)bce->be->BeaconInfo; |
362 | bf = (void *) be->BeaconInfo; | 360 | ies_len = be->wBeaconInfoLength - sizeof(struct uwb_beacon_frame); |
363 | uwb_ie_for_each(uwb_dev, uwb_ie_dump_hex, &ctx, | 361 | ies = (struct uwb_ie_hdr *)bf->IEData; |
364 | bf->IEData, be->wBeaconInfoLength - sizeof(*bf)); | 362 | |
365 | result = ctx.bytes; | 363 | result = uwb_ie_dump_hex(ies, ies_len, buf, size); |
366 | out: | 364 | } |
365 | |||
367 | mutex_unlock(&bce->mutex); | 366 | mutex_unlock(&bce->mutex); |
367 | |||
368 | return result; | 368 | return result; |
369 | } | 369 | } |
370 | 370 | ||