Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fae35f9 authored by David Vrabel's avatar David Vrabel
Browse files

uwb: add basic radio manager



The UWB radio manager coordinates the use of the radio between the
PALs that may be using it.  PALs request use of the radio with
uwb_radio_start() and the radio manager will start beaconing if its
not already doing so.  When the last PAL has called uwb_radio_stop()
beaconing will be stopped.

In the future, the radio manager will have a more sophisticated channel
selection algorithm, probably following the Channel Selection Policy
from the WiMedia Alliance when it is finalized.  For now, channel 9
(BG1, TFC1) is selected.

The user may override the channel selected by the radio manager and may
force the radio to stop beaconing.

The WUSB Host Controller PAL makes use of this and there are two new
debug PAL commands that can be used for testing.

Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
parent e17be2b2
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -32,14 +32,16 @@ Contact: linux-usb@vger.kernel.org
Description:
                Write:

                <channel> [<bpst offset>]
                <channel>

                to start beaconing on a specific channel, or stop
                beaconing if <channel> is -1.  Valid channels depends
                on the radio controller's supported band groups.
                to force a specific channel to be used when beaconing,
                or, if <channel> is -1, to prohibit beaconing.  If
                <channel> is 0, then the default channel selection
                algorithm will be used.  Valid channels depends on the
                radio controller's supported band groups.

                <bpst offset> may be used to try and join a specific
                beacon group if more than one was found during a scan.
                Reading returns the currently active channel, or -1 if
                the radio controller is not beaconing.

What:           /sys/class/uwb_rc/uwbN/scan
Date:           July 2008
+0 −9
Original line number Diff line number Diff line
@@ -80,12 +80,6 @@ case $1 in
    start)
        for dev in ${2:-$hdevs}
          do
          uwb_rc=$(readlink -f $dev/uwb_rc)
          if cat $uwb_rc/beacon | grep -q -- "-1"
              then
              echo 13 0 > $uwb_rc/beacon
              echo I: started beaconing on ch 13 on $(basename $uwb_rc) >&2
          fi
          echo $host_CHID > $dev/wusb_chid
          echo I: started host $(basename $dev) >&2
        done
@@ -95,9 +89,6 @@ case $1 in
          do
          echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid
          echo I: stopped host $(basename $dev) >&2
          uwb_rc=$(readlink -f $dev/uwb_rc)
          echo -1 | cat > $uwb_rc/beacon
          echo I: stopped beaconing on $(basename $uwb_rc) >&2
        done
        ;;
    set-chid)
+0 −1
Original line number Diff line number Diff line
@@ -221,7 +221,6 @@ static void hwahc_op_stop(struct usb_hcd *usb_hcd)

	d_fnstart(4, dev, "(hwahc %p)\n", hwahc);
	mutex_lock(&wusbhc->mutex);
	wusbhc_stop(wusbhc);
	wusb_cluster_id_put(wusbhc->cluster_id);
	mutex_unlock(&wusbhc->mutex);
	d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result);
+0 −2
Original line number Diff line number Diff line
@@ -91,8 +91,6 @@ static void whc_stop(struct usb_hcd *usb_hcd)

	mutex_lock(&wusbhc->mutex);

	wusbhc_stop(wusbhc);

	/* stop HC */
	le_writel(0, whc->base + WUSBINTR);
	whc_write_wusbcmd(whc, WUSBCMD_RUN, 0);
+2 −3
Original line number Diff line number Diff line
@@ -1124,8 +1124,7 @@ void wusbhc_devconnect_destroy(struct wusbhc *wusbhc)
 * FIXME: This also enables the keep alives but this is not necessary
 * until there are connected and authenticated devices.
 */
int wusbhc_devconnect_start(struct wusbhc *wusbhc,
			    const struct wusb_ckhdid *chid)
int wusbhc_devconnect_start(struct wusbhc *wusbhc)
{
	struct device *dev = wusbhc->dev;
	struct wuie_host_info *hi;
@@ -1138,7 +1137,7 @@ int wusbhc_devconnect_start(struct wusbhc *wusbhc,
	hi->hdr.bLength       = sizeof(*hi);
	hi->hdr.bIEIdentifier = WUIE_ID_HOST_INFO;
	hi->attributes        = cpu_to_le16((wusbhc->rsv->stream << 3) | WUIE_HI_CAP_ALL);
	hi->CHID              = *chid;
	hi->CHID              = wusbhc->chid;
	result = wusbhc_mmcie_set(wusbhc, 0, 0, &hi->hdr);
	if (result < 0) {
		dev_err(dev, "Cannot add Host Info MMCIE: %d\n", result);
Loading