FreeBSD Bugzilla – Attachment 150686 Details for
Bug 196069
[wpi] [patch]: refactor wpi_scan()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for if_wpi.c (wpi_scan()) / if_wpireg.h
patch-wpi-refactor.diff (text/plain), 3.09 KB, created by
Andriy Voskoboinyk
on 2014-12-17 17:43:29 UTC
(
hide
)
Description:
Patch for if_wpi.c (wpi_scan()) / if_wpireg.h
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2014-12-17 17:43:29 UTC
Size:
3.09 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 274280) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -2540,6 +2545,18 @@ > } > > /* >+ * Add an ssid element to a frame. >+ */ >+static uint8_t * >+ieee80211_add_ssid(uint8_t *frm, const uint8_t *ssid, u_int len) >+{ >+ *frm++ = IEEE80211_ELEMID_SSID; >+ *frm++ = len; >+ memcpy(frm, ssid, len); >+ return frm + len; >+} >+ >+/* > * Send a scan request to the firmware. Since this command is huge, we map it > * into a mbufcluster instead of using the pre-allocated set of commands. Note, > * much of this code is similar to that in wpi_cmd but because we must manually >@@ -2564,7 +2581,7 @@ > struct ieee80211_channel *c; > enum ieee80211_phymode mode; > uint8_t *frm; >- int nrates, pktlen, error, i, nssid; >+ int pktlen, error, i, nssid; > bus_addr_t physaddr; > > desc = &ring->desc[ring->cur]; >@@ -2613,7 +2630,7 @@ > nssid = MIN(ss->ss_nssid, WPI_SCAN_MAX_ESSIDS); > for (i = 0; i < nssid; i++) { > hdr->scan_essids[i].id = IEEE80211_ELEMID_SSID; >- hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, 32); >+ hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, IEEE80211_NWID_LEN); > memcpy(hdr->scan_essids[i].essid, ss->ss_ssid[i].ssid, > hdr->scan_essids[i].esslen); > #ifdef WPI_DEBUG >@@ -2630,7 +2647,7 @@ > * Build a probe request frame. Most of the following code is a > * copy & paste of what is done in net80211. > */ >- wh = (struct ieee80211_frame *)&hdr->scan_essids[4]; >+ wh = (struct ieee80211_frame *)&hdr->scan_essids[WPI_SCAN_MAX_ESSIDS]; > wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | > IEEE80211_FC0_SUBTYPE_PROBE_REQ; > wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; >@@ -2642,31 +2659,13 @@ > > frm = (uint8_t *)(wh + 1); > >- /* add essid IE, the hardware will fill this in for us */ >- *frm++ = IEEE80211_ELEMID_SSID; >- *frm++ = 0; >- > mode = ieee80211_chan2mode(ic->ic_curchan); > rs = &ic->ic_sup_rates[mode]; > >- /* add supported rates IE */ >- *frm++ = IEEE80211_ELEMID_RATES; >- nrates = rs->rs_nrates; >- if (nrates > IEEE80211_RATE_SIZE) >- nrates = IEEE80211_RATE_SIZE; >- *frm++ = nrates; >- memcpy(frm, rs->rs_rates, nrates); >- frm += nrates; >+ frm = ieee80211_add_ssid(frm, NULL, 0); >+ frm = ieee80211_add_rates(frm, rs); >+ frm = ieee80211_add_xrates(frm, rs); > >- /* add supported xrates IE */ >- if (rs->rs_nrates > IEEE80211_RATE_SIZE) { >- nrates = rs->rs_nrates - IEEE80211_RATE_SIZE; >- *frm++ = IEEE80211_ELEMID_XRATES; >- *frm++ = nrates; >- memcpy(frm, rs->rs_rates + IEEE80211_RATE_SIZE, nrates); >- frm += nrates; >- } >- > /* setup length of probe request */ > hdr->tx.len = htole16(frm - (uint8_t *)wh); > >Index: sys/dev/wpi/if_wpireg.h >=================================================================== >--- sys/dev/wpi/if_wpireg.h (revision 274280) >+++ sys/dev/wpi/if_wpireg.h (working copy) >@@ -511,7 +511,7 @@ > struct { > uint8_t id; > uint8_t esslen; >- uint8_t essid[32]; >+ uint8_t essid[IEEE80211_NWID_LEN]; > }scan_essids[WPI_SCAN_MAX_ESSIDS]; > /* followed by probe request body */ > /* followed by nchan x wpi_scan_chan */
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 196069
:
150686
|
150752