Skip to content

Commit

Permalink
uwb: improved MAS allocator and reservation conflict handling
Browse files Browse the repository at this point in the history
Greatly enhance the MAS allocator:
  - Handle row and column reservations.
  - Permit all the available MAS to be allocated.
  - Follows the WiMedia rules on MAS selection.

Take appropriate action when reservation conflicts are detected.
  - Correctly identify which reservation wins the conflict.
  - Protect alien BP reservations.
  - If an owned reservation loses, resize/move it.
  - Follow the backoff procedure before requesting additional MAS.

When reservations are terminated, move the remaining reservations (if
necessary) so they keep following the MAS allocation rules.

Signed-off-by: Stefano Panella <stefano.panella@csr.com>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
  • Loading branch information
Stefano Panella authored and David Vrabel committed Dec 12, 2008
1 parent c35fa3e commit 5b37717
Show file tree
Hide file tree
Showing 12 changed files with 1,603 additions and 327 deletions.
13 changes: 7 additions & 6 deletions drivers/usb/wusbcore/reservation.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ static void wusbhc_rsv_complete_cb(struct uwb_rsv *rsv)
{
struct wusbhc *wusbhc = rsv->pal_priv;
struct device *dev = wusbhc->dev;
struct uwb_mas_bm mas;
char buf[72];

switch (rsv->state) {
case UWB_RSV_STATE_O_ESTABLISHED:
bitmap_scnprintf(buf, sizeof(buf), rsv->mas.bm, UWB_NUM_MAS);
uwb_rsv_get_usable_mas(rsv, &mas);
bitmap_scnprintf(buf, sizeof(buf), mas.bm, UWB_NUM_MAS);
dev_dbg(dev, "established reservation: %s\n", buf);
wusbhc_bwa_set(wusbhc, rsv->stream, &rsv->mas);
wusbhc_bwa_set(wusbhc, rsv->stream, &mas);
break;
case UWB_RSV_STATE_NONE:
dev_dbg(dev, "removed reservation\n");
Expand Down Expand Up @@ -85,13 +87,12 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc)
bcid.data[0] = wusbhc->cluster_id;
bcid.data[1] = 0;

rsv->owner = &rc->uwb_dev;
rsv->target.type = UWB_RSV_TARGET_DEVADDR;
rsv->target.devaddr = bcid;
rsv->type = UWB_DRP_TYPE_PRIVATE;
rsv->max_mas = 256;
rsv->min_mas = 16; /* one MAS per zone? */
rsv->sparsity = 16; /* at least one MAS in each zone? */
rsv->max_mas = 256; /* try to get as much as possible */
rsv->min_mas = 15; /* one MAS per zone */
rsv->max_interval = 1; /* max latency is one zone */
rsv->is_multicast = true;

ret = uwb_rsv_establish(rsv);
Expand Down
1 change: 1 addition & 0 deletions drivers/uwb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ obj-$(CONFIG_UWB_I1480U) += i1480/

uwb-objs := \
address.o \
allocator.o \
beacon.o \
driver.o \
drp.o \
Expand Down
Loading

0 comments on commit 5b37717

Please sign in to comment.