FreeBSD Bugzilla – Attachment 154021 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
(Non-functional) Replace few numbers with named constants
patch-wpi16.diff (text/plain), 3.40 KB, created by
Andriy Voskoboinyk
on 2015-03-08 16:20:27 UTC
(
hide
)
Description:
(Non-functional) Replace few numbers with named constants
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-08 16:20:27 UTC
Size:
3.40 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 279775) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -1138,7 +1138,7 @@ > * to allocate commands space for other rings. > * XXX Do we really need to allocate descriptors for other rings? > */ >- if (qid > 4) >+ if (qid > WPI_CMD_QUEUE_NUM) > return 0; > > size = WPI_TX_RING_COUNT * sizeof (struct wpi_tx_cmd); >@@ -1806,7 +1806,7 @@ > tap->wr_flags = 0; > if (head->flags & htole16(WPI_STAT_FLAG_SHPREAMBLE)) > tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; >- tap->wr_dbm_antsignal = (int8_t)(stat->rssi - WPI_RSSI_OFFSET); >+ tap->wr_dbm_antsignal = (int8_t)(stat->rssi + WPI_RSSI_OFFSET); > tap->wr_dbm_antnoise = (int8_t)le16toh(stat->noise); > tap->wr_tsft = tail->tstamp; > tap->wr_antenna = (le16toh(head->flags) >> 4) & 0xf; >@@ -1817,11 +1817,11 @@ > > /* Send the frame to the 802.11 layer. */ > if (ni != NULL) { >- (void)ieee80211_input(ni, m, stat->rssi, -WPI_RSSI_OFFSET); >+ (void)ieee80211_input(ni, m, stat->rssi, WPI_RSSI_OFFSET); > /* Node is no longer needed. */ > ieee80211_free_node(ni); > } else >- (void)ieee80211_input_all(ic, m, stat->rssi, -WPI_RSSI_OFFSET); >+ (void)ieee80211_input_all(ic, m, stat->rssi, WPI_RSSI_OFFSET); > > WPI_LOCK(sc); > >@@ -1906,7 +1906,7 @@ > static void > wpi_cmd_done(struct wpi_softc *sc, struct wpi_rx_desc *desc) > { >- struct wpi_tx_ring *ring = &sc->txq[4]; >+ struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM]; > struct wpi_tx_data *data; > > DPRINTF(sc, WPI_DEBUG_CMD, "cmd notification qid=%x idx=%d flags=%x " >@@ -1914,7 +1914,7 @@ > desc->flags, wpi_cmd_str(desc->type), > le32toh(desc->len)); > >- if ((desc->qid & 7) != 4) >+ if ((desc->qid & WPI_RX_DESC_QID_MSK) != WPI_CMD_QUEUE_NUM) > return; /* Not a command ack. */ > > data = &ring->data[desc->idx]; >@@ -1961,8 +1961,10 @@ > __func__, sc->rxq.cur, desc->qid, desc->idx, desc->flags, > desc->type, wpi_cmd_str(desc->type), le32toh(desc->len)); > >- if (!(desc->qid & 0x80)) /* Reply to a command. */ >+ if (!(desc->qid & WPI_UNSOLICITED_RX_NOTIF)) { >+ /* Reply to a command. */ > wpi_cmd_done(sc, desc); >+ } > > switch (desc->type) { > case WPI_RX_DONE: >@@ -2804,7 +2806,7 @@ > wpi_cmd(struct wpi_softc *sc, int code, const void *buf, size_t size, > int async) > { >- struct wpi_tx_ring *ring = &sc->txq[4]; >+ struct wpi_tx_ring *ring = &sc->txq[WPI_CMD_QUEUE_NUM]; > struct wpi_tx_desc *desc; > struct wpi_tx_data *data; > struct wpi_tx_cmd *cmd; >Index: sys/dev/wpi/if_wpireg.h >=================================================================== >--- sys/dev/wpi/if_wpireg.h (revision 279775) >+++ sys/dev/wpi/if_wpireg.h (working copy) >@@ -25,6 +25,8 @@ > > #define WPI_NTXQUEUES 8 > #define WPI_DRV_NTXQUEUES 5 >+#define WPI_CMD_QUEUE_NUM 4 >+ > #define WPI_NDMACHNLS 6 > > /* Maximum scatter/gather. */ >@@ -222,7 +224,7 @@ > #define WPI_APMG_PCI_STT_L1A_DIS (1 << 11) > > struct wpi_shared { >- uint32_t txbase[8]; >+ uint32_t txbase[WPI_NTXQUEUES]; > uint32_t next; > uint32_t reserved[2]; > } __packed; >@@ -269,6 +271,9 @@ > uint8_t qid; > } __packed; > >+#define WPI_RX_DESC_QID_MSK 0x07 >+#define WPI_UNSOLICITED_RX_NOTIF 0x80 >+ > struct wpi_rx_stat { > uint8_t len; > #define WPI_STAT_MAXLEN 20 >@@ -275,7 +280,7 @@ > > uint8_t id; > uint8_t rssi; /* received signal strength */ >-#define WPI_RSSI_OFFSET 95 >+#define WPI_RSSI_OFFSET -95 > > uint8_t agc; /* access gain control */ > uint16_t signal;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
|
153985
|
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
| 154021 |
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
|
154349
|
154350
|
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
|
154368
|
154369
|
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195