Page MenuHomeFreeBSD

D3847.diff
No OneTemporary

D3847.diff

Index: head/sys/dev/usb/wlan/if_urtwn.c
===================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c
+++ head/sys/dev/usb/wlan/if_urtwn.c
@@ -188,10 +188,10 @@
struct urtwn_data[], int, int);
static int urtwn_alloc_rx_list(struct urtwn_softc *);
static int urtwn_alloc_tx_list(struct urtwn_softc *);
-static void urtwn_free_tx_list(struct urtwn_softc *);
-static void urtwn_free_rx_list(struct urtwn_softc *);
static void urtwn_free_list(struct urtwn_softc *,
struct urtwn_data data[], int);
+static void urtwn_free_rx_list(struct urtwn_softc *);
+static void urtwn_free_tx_list(struct urtwn_softc *);
static struct urtwn_data * _urtwn_getbuf(struct urtwn_softc *);
static struct urtwn_data * urtwn_getbuf(struct urtwn_softc *);
static int urtwn_write_region_1(struct urtwn_softc *, uint16_t,
@@ -265,10 +265,10 @@
static void urtwn_scan_start(struct ieee80211com *);
static void urtwn_scan_end(struct ieee80211com *);
static void urtwn_set_channel(struct ieee80211com *);
+static void urtwn_update_mcast(struct ieee80211com *);
static void urtwn_set_chan(struct urtwn_softc *,
struct ieee80211_channel *,
struct ieee80211_channel *);
-static void urtwn_update_mcast(struct ieee80211com *);
static void urtwn_iq_calib(struct urtwn_softc *);
static void urtwn_lc_calib(struct urtwn_softc *);
static void urtwn_init(struct urtwn_softc *);
@@ -470,20 +470,6 @@
return (ENXIO); /* failure */
}
-static void
-urtwn_drain_mbufq(struct urtwn_softc *sc)
-{
- struct mbuf *m;
- struct ieee80211_node *ni;
- URTWN_ASSERT_LOCKED(sc);
- while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
- ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
- m->m_pkthdr.rcvif = NULL;
- ieee80211_free_node(ni);
- m_freem(m);
- }
-}
-
static int
urtwn_detach(device_t self)
{
@@ -529,33 +515,16 @@
}
static void
-urtwn_free_tx_list(struct urtwn_softc *sc)
-{
- urtwn_free_list(sc, sc->sc_tx, URTWN_TX_LIST_COUNT);
-}
-
-static void
-urtwn_free_rx_list(struct urtwn_softc *sc)
-{
- urtwn_free_list(sc, sc->sc_rx, URTWN_RX_LIST_COUNT);
-}
-
-static void
-urtwn_free_list(struct urtwn_softc *sc, struct urtwn_data data[], int ndata)
+urtwn_drain_mbufq(struct urtwn_softc *sc)
{
- int i;
-
- for (i = 0; i < ndata; i++) {
- struct urtwn_data *dp = &data[i];
-
- if (dp->buf != NULL) {
- free(dp->buf, M_USBDEV);
- dp->buf = NULL;
- }
- if (dp->ni != NULL) {
- ieee80211_free_node(dp->ni);
- dp->ni = NULL;
- }
+ struct mbuf *m;
+ struct ieee80211_node *ni;
+ URTWN_ASSERT_LOCKED(sc);
+ while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
+ ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
+ m->m_pkthdr.rcvif = NULL;
+ ieee80211_free_node(ni);
+ m_freem(m);
}
}
@@ -874,6 +843,102 @@
sc->sc_txtimer = 0;
}
+static int
+urtwn_alloc_list(struct urtwn_softc *sc, struct urtwn_data data[],
+ int ndata, int maxsz)
+{
+ int i, error;
+
+ for (i = 0; i < ndata; i++) {
+ struct urtwn_data *dp = &data[i];
+ dp->sc = sc;
+ dp->m = NULL;
+ dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT);
+ if (dp->buf == NULL) {
+ device_printf(sc->sc_dev,
+ "could not allocate buffer\n");
+ error = ENOMEM;
+ goto fail;
+ }
+ dp->ni = NULL;
+ }
+
+ return (0);
+fail:
+ urtwn_free_list(sc, data, ndata);
+ return (error);
+}
+
+static int
+urtwn_alloc_rx_list(struct urtwn_softc *sc)
+{
+ int error, i;
+
+ error = urtwn_alloc_list(sc, sc->sc_rx, URTWN_RX_LIST_COUNT,
+ URTWN_RXBUFSZ);
+ if (error != 0)
+ return (error);
+
+ STAILQ_INIT(&sc->sc_rx_active);
+ STAILQ_INIT(&sc->sc_rx_inactive);
+
+ for (i = 0; i < URTWN_RX_LIST_COUNT; i++)
+ STAILQ_INSERT_HEAD(&sc->sc_rx_inactive, &sc->sc_rx[i], next);
+
+ return (0);
+}
+
+static int
+urtwn_alloc_tx_list(struct urtwn_softc *sc)
+{
+ int error, i;
+
+ error = urtwn_alloc_list(sc, sc->sc_tx, URTWN_TX_LIST_COUNT,
+ URTWN_TXBUFSZ);
+ if (error != 0)
+ return (error);
+
+ STAILQ_INIT(&sc->sc_tx_active);
+ STAILQ_INIT(&sc->sc_tx_inactive);
+ STAILQ_INIT(&sc->sc_tx_pending);
+
+ for (i = 0; i < URTWN_TX_LIST_COUNT; i++)
+ STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, &sc->sc_tx[i], next);
+
+ return (0);
+}
+
+static void
+urtwn_free_list(struct urtwn_softc *sc, struct urtwn_data data[], int ndata)
+{
+ int i;
+
+ for (i = 0; i < ndata; i++) {
+ struct urtwn_data *dp = &data[i];
+
+ if (dp->buf != NULL) {
+ free(dp->buf, M_USBDEV);
+ dp->buf = NULL;
+ }
+ if (dp->ni != NULL) {
+ ieee80211_free_node(dp->ni);
+ dp->ni = NULL;
+ }
+ }
+}
+
+static void
+urtwn_free_rx_list(struct urtwn_softc *sc)
+{
+ urtwn_free_list(sc, sc->sc_rx, URTWN_RX_LIST_COUNT);
+}
+
+static void
+urtwn_free_tx_list(struct urtwn_softc *sc)
+{
+ urtwn_free_list(sc, sc->sc_tx, URTWN_TX_LIST_COUNT);
+}
+
static void
urtwn_bulk_tx_callback(struct usb_xfer *xfer, usb_error_t error)
{
@@ -1762,7 +1827,6 @@
return (rssi);
}
-
static int
urtwn_tx_start(struct urtwn_softc *sc, struct ieee80211_node *ni,
struct mbuf *m0, struct urtwn_data *data)
@@ -1980,71 +2044,6 @@
ieee80211_start_all(ic);
}
-static int
-urtwn_alloc_list(struct urtwn_softc *sc, struct urtwn_data data[],
- int ndata, int maxsz)
-{
- int i, error;
-
- for (i = 0; i < ndata; i++) {
- struct urtwn_data *dp = &data[i];
- dp->sc = sc;
- dp->m = NULL;
- dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT);
- if (dp->buf == NULL) {
- device_printf(sc->sc_dev,
- "could not allocate buffer\n");
- error = ENOMEM;
- goto fail;
- }
- dp->ni = NULL;
- }
-
- return (0);
-fail:
- urtwn_free_list(sc, data, ndata);
- return (error);
-}
-
-static int
-urtwn_alloc_rx_list(struct urtwn_softc *sc)
-{
- int error, i;
-
- error = urtwn_alloc_list(sc, sc->sc_rx, URTWN_RX_LIST_COUNT,
- URTWN_RXBUFSZ);
- if (error != 0)
- return (error);
-
- STAILQ_INIT(&sc->sc_rx_active);
- STAILQ_INIT(&sc->sc_rx_inactive);
-
- for (i = 0; i < URTWN_RX_LIST_COUNT; i++)
- STAILQ_INSERT_HEAD(&sc->sc_rx_inactive, &sc->sc_rx[i], next);
-
- return (0);
-}
-
-static int
-urtwn_alloc_tx_list(struct urtwn_softc *sc)
-{
- int error, i;
-
- error = urtwn_alloc_list(sc, sc->sc_tx, URTWN_TX_LIST_COUNT,
- URTWN_TXBUFSZ);
- if (error != 0)
- return (error);
-
- STAILQ_INIT(&sc->sc_tx_active);
- STAILQ_INIT(&sc->sc_tx_inactive);
- STAILQ_INIT(&sc->sc_tx_pending);
-
- for (i = 0; i < URTWN_TX_LIST_COUNT; i++)
- STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, &sc->sc_tx[i], next);
-
- return (0);
-}
-
static __inline int
urtwn_power_on(struct urtwn_softc *sc)
{
@@ -2685,7 +2684,7 @@
}
}
-void
+static void
urtwn_rf_init(struct urtwn_softc *sc)
{
const struct urtwn_rf_prog *prog;
@@ -2826,7 +2825,7 @@
urtwn_write_4(sc, R92C_EDCA_VO_PARAM, 0x002fa226);
}
-void
+static void
urtwn_write_txpower(struct urtwn_softc *sc, int chain,
uint16_t power[URTWN_RIDX_COUNT])
{
@@ -2886,7 +2885,7 @@
SM(R92C_TXAGC_MCS15, power[27]));
}
-void
+static void
urtwn_get_txpower(struct urtwn_softc *sc, int chain,
struct ieee80211_channel *c, struct ieee80211_channel *extc,
uint16_t power[URTWN_RIDX_COUNT])
@@ -2985,7 +2984,7 @@
#endif
}
-void
+static void
urtwn_r88e_get_txpower(struct urtwn_softc *sc, int chain,
struct ieee80211_channel *c, struct ieee80211_channel *extc,
uint16_t power[URTWN_RIDX_COUNT])
@@ -3054,7 +3053,7 @@
}
}
-void
+static void
urtwn_set_txpower(struct urtwn_softc *sc, struct ieee80211_channel *c,
struct ieee80211_channel *extc)
{

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 27, 11:29 PM (1 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26266267
Default Alt Text
D3847.diff (7 KB)

Event Timeline