Lines 1138-1144
Link Here
|
1138 |
* to allocate commands space for other rings. |
1138 |
* to allocate commands space for other rings. |
1139 |
* XXX Do we really need to allocate descriptors for other rings? |
1139 |
* XXX Do we really need to allocate descriptors for other rings? |
1140 |
*/ |
1140 |
*/ |
1141 |
if (qid > 4) |
1141 |
if (qid > WPI_CMD_QUEUE_NUM) |
1142 |
return 0; |
1142 |
return 0; |
1143 |
|
1143 |
|
1144 |
size = WPI_TX_RING_COUNT * sizeof (struct wpi_tx_cmd); |
1144 |
size = WPI_TX_RING_COUNT * sizeof (struct wpi_tx_cmd); |
Lines 1806-1812
Link Here
|
1806 |
tap->wr_flags = 0; |
1806 |
tap->wr_flags = 0; |
1807 |
if (head->flags & htole16(WPI_STAT_FLAG_SHPREAMBLE)) |
1807 |
if (head->flags & htole16(WPI_STAT_FLAG_SHPREAMBLE)) |
1808 |
tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; |
1808 |
tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; |
1809 |
tap->wr_dbm_antsignal = (int8_t)(stat->rssi - WPI_RSSI_OFFSET); |
1809 |
tap->wr_dbm_antsignal = (int8_t)(stat->rssi + WPI_RSSI_OFFSET); |
1810 |
tap->wr_dbm_antnoise = (int8_t)le16toh(stat->noise); |
1810 |
tap->wr_dbm_antnoise = (int8_t)le16toh(stat->noise); |
1811 |
tap->wr_tsft = tail->tstamp; |
1811 |
tap->wr_tsft = tail->tstamp; |
1812 |
tap->wr_antenna = (le16toh(head->flags) >> 4) & 0xf; |
1812 |
tap->wr_antenna = (le16toh(head->flags) >> 4) & 0xf; |
Lines 1817-1827
Link Here
|
1817 |
|
1817 |
|
1818 |
/* Send the frame to the 802.11 layer. */ |
1818 |
/* Send the frame to the 802.11 layer. */ |
1819 |
if (ni != NULL) { |
1819 |
if (ni != NULL) { |
1820 |
(void)ieee80211_input(ni, m, stat->rssi, -WPI_RSSI_OFFSET); |
1820 |
(void)ieee80211_input(ni, m, stat->rssi, WPI_RSSI_OFFSET); |
1821 |
/* Node is no longer needed. */ |
1821 |
/* Node is no longer needed. */ |
1822 |
ieee80211_free_node(ni); |
1822 |
ieee80211_free_node(ni); |
1823 |
} else |
1823 |
} else |
1824 |
(void)ieee80211_input_all(ic, m, stat->rssi, -WPI_RSSI_OFFSET); |
1824 |
(void)ieee80211_input_all(ic, m, stat->rssi, WPI_RSSI_OFFSET); |
1825 |
|
1825 |
|
1826 |
WPI_LOCK(sc); |
1826 |
WPI_LOCK(sc); |
1827 |
|
1827 |
|
Lines 1906-1912
Link Here
|
1906 |
static void |
1906 |
static void |
1907 |
wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) |
1907 |
wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) |
1908 |
{ |
1908 |
{ |
1909 |
struct wpi_tx_ring *ring = &sc->txq[4]; |
1909 |
struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM]; |
1910 |
struct wpi_tx_data *data; |
1910 |
struct wpi_tx_data *data; |
1911 |
|
1911 |
|
1912 |
DPRINTF(sc, WPI_DEBUG_CMD, "cmd notification qid=%x idx=%d flags=%x " |
1912 |
DPRINTF(sc, WPI_DEBUG_CMD, "cmd notification qid=%x idx=%d flags=%x " |
Lines 1914-1920
Link Here
|
1914 |
desc->flags, wpi_cmd_str(desc->type), |
1914 |
desc->flags, wpi_cmd_str(desc->type), |
1915 |
le32toh(desc->len)); |
1915 |
le32toh(desc->len)); |
1916 |
|
1916 |
|
1917 |
if ((desc->qid & 7) != 4) |
1917 |
if ((desc->qid & WPI_RX_DESC_QID_MSK) != WPI_CMD_QUEUE_NUM) |
1918 |
return; /* Not a command ack. */ |
1918 |
return; /* Not a command ack. */ |
1919 |
|
1919 |
|
1920 |
data = &ring->data[desc->idx]; |
1920 |
data = &ring->data[desc->idx]; |
Lines 1961-1968
Link Here
|
1961 |
__func__, sc->rxq.cur, desc->qid, desc->idx, desc->flags, |
1961 |
__func__, sc->rxq.cur, desc->qid, desc->idx, desc->flags, |
1962 |
desc->type, wpi_cmd_str(desc->type), le32toh(desc->len)); |
1962 |
desc->type, wpi_cmd_str(desc->type), le32toh(desc->len)); |
1963 |
|
1963 |
|
1964 |
if (!(desc->qid & 0x80)) /* Reply to a command. */ |
1964 |
if (!(desc->qid & WPI_UNSOLICITED_RX_NOTIF)) { |
|
|
1965 |
/* Reply to a command. */ |
1965 |
wpi_cmd_done(sc, desc); |
1966 |
wpi_cmd_done(sc, desc); |
|
|
1967 |
} |
1966 |
|
1968 |
|
1967 |
switch (desc->type) { |
1969 |
switch (desc->type) { |
1968 |
case WPI_RX_DONE: |
1970 |
case WPI_RX_DONE: |
Lines 2804-2810
Link Here
|
2804 |
wpi_cmd(struct wpi_softc *sc, int code, const void *buf, size_t size, |
2806 |
wpi_cmd(struct wpi_softc *sc, int code, const void *buf, size_t size, |
2805 |
int async) |
2807 |
int async) |
2806 |
{ |
2808 |
{ |
2807 |
struct wpi_tx_ring *ring = &sc->txq[4]; |
2809 |
struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM]; |
2808 |
struct wpi_tx_desc *desc; |
2810 |
struct wpi_tx_desc *desc; |
2809 |
struct wpi_tx_data *data; |
2811 |
struct wpi_tx_data *data; |
2810 |
struct wpi_tx_cmd *cmd; |
2812 |
struct wpi_tx_cmd *cmd; |