aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore
diff options
context:
space:
mode:
authorStefano Panella <stefano.panella@csr.com>2008-12-12 08:00:06 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-12-12 08:00:06 -0500
commit5b37717a23b8e40f6cf7ad85a26ddcf41c171e2c (patch)
tree3c611f907bc61c6e1900c4092e8f2f1e8eefd907 /drivers/usb/wusbcore
parentc35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59 (diff)
uwb: improved MAS allocator and reservation conflict handling
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>
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r--drivers/usb/wusbcore/reservation.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/wusbcore/reservation.c b/drivers/usb/wusbcore/reservation.c
index 7b6525dac2f1..c37e4f83e54a 100644
--- a/drivers/usb/wusbcore/reservation.c
+++ b/drivers/usb/wusbcore/reservation.c
@@ -48,13 +48,15 @@ static void wusbhc_rsv_complete_cb(struct uwb_rsv *rsv)
48{ 48{
49 struct wusbhc *wusbhc = rsv->pal_priv; 49 struct wusbhc *wusbhc = rsv->pal_priv;
50 struct device *dev = wusbhc->dev; 50 struct device *dev = wusbhc->dev;
51 struct uwb_mas_bm mas;
51 char buf[72]; 52 char buf[72];
52 53
53 switch (rsv->state) { 54 switch (rsv->state) {
54 case UWB_RSV_STATE_O_ESTABLISHED: 55 case UWB_RSV_STATE_O_ESTABLISHED:
55 bitmap_scnprintf(buf, sizeof(buf), rsv->mas.bm, UWB_NUM_MAS); 56 uwb_rsv_get_usable_mas(rsv, &mas);
57 bitmap_scnprintf(buf, sizeof(buf), mas.bm, UWB_NUM_MAS);
56 dev_dbg(dev, "established reservation: %s\n", buf); 58 dev_dbg(dev, "established reservation: %s\n", buf);
57 wusbhc_bwa_set(wusbhc, rsv->stream, &rsv->mas); 59 wusbhc_bwa_set(wusbhc, rsv->stream, &mas);
58 break; 60 break;
59 case UWB_RSV_STATE_NONE: 61 case UWB_RSV_STATE_NONE:
60 dev_dbg(dev, "removed reservation\n"); 62 dev_dbg(dev, "removed reservation\n");
@@ -85,13 +87,12 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc)
85 bcid.data[0] = wusbhc->cluster_id; 87 bcid.data[0] = wusbhc->cluster_id;
86 bcid.data[1] = 0; 88 bcid.data[1] = 0;
87 89
88 rsv->owner = &rc->uwb_dev;
89 rsv->target.type = UWB_RSV_TARGET_DEVADDR; 90 rsv->target.type = UWB_RSV_TARGET_DEVADDR;
90 rsv->target.devaddr = bcid; 91 rsv->target.devaddr = bcid;
91 rsv->type = UWB_DRP_TYPE_PRIVATE; 92 rsv->type = UWB_DRP_TYPE_PRIVATE;
92 rsv->max_mas = 256; 93 rsv->max_mas = 256; /* try to get as much as possible */
93 rsv->min_mas = 16; /* one MAS per zone? */ 94 rsv->min_mas = 15; /* one MAS per zone */
94 rsv->sparsity = 16; /* at least one MAS in each zone? */ 95 rsv->max_interval = 1; /* max latency is one zone */
95 rsv->is_multicast = true; 96 rsv->is_multicast = true;
96 97
97 ret = uwb_rsv_establish(rsv); 98 ret = uwb_rsv_establish(rsv);