View | Details | Raw Unified | Return to bug 197143 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-8 / +10 lines)
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;
(-)sys/dev/wpi/if_wpireg.h (-2 / +7 lines)
Lines 25-30 Link Here
25
25
26
#define WPI_NTXQUEUES		8
26
#define WPI_NTXQUEUES		8
27
#define WPI_DRV_NTXQUEUES	5
27
#define WPI_DRV_NTXQUEUES	5
28
#define WPI_CMD_QUEUE_NUM	4
29
28
#define WPI_NDMACHNLS		6
30
#define WPI_NDMACHNLS		6
29
31
30
/* Maximum scatter/gather. */
32
/* Maximum scatter/gather. */
Lines 222-228 Link Here
222
#define WPI_APMG_PCI_STT_L1A_DIS	(1 << 11)
224
#define WPI_APMG_PCI_STT_L1A_DIS	(1 << 11)
223
225
224
struct wpi_shared {
226
struct wpi_shared {
225
	uint32_t	txbase[8];
227
	uint32_t	txbase[WPI_NTXQUEUES];
226
	uint32_t	next;
228
	uint32_t	next;
227
	uint32_t	reserved[2];
229
	uint32_t	reserved[2];
228
} __packed;
230
} __packed;
Lines 269-274 Link Here
269
	uint8_t		qid;
271
	uint8_t		qid;
270
} __packed;
272
} __packed;
271
273
274
#define WPI_RX_DESC_QID_MSK		0x07
275
#define WPI_UNSOLICITED_RX_NOTIF	0x80
276
272
struct wpi_rx_stat {
277
struct wpi_rx_stat {
273
	uint8_t		len;
278
	uint8_t		len;
274
#define WPI_STAT_MAXLEN	20
279
#define WPI_STAT_MAXLEN	20
Lines 275-281 Link Here
275
280
276
	uint8_t		id;
281
	uint8_t		id;
277
	uint8_t		rssi;	/* received signal strength */
282
	uint8_t		rssi;	/* received signal strength */
278
#define WPI_RSSI_OFFSET	95
283
#define WPI_RSSI_OFFSET	-95
279
284
280
	uint8_t		agc;	/* access gain control */
285
	uint8_t		agc;	/* access gain control */
281
	uint16_t	signal;
286
	uint16_t	signal;

Return to bug 197143