Deleted Added
full compact
if_rsu.c (292080) if_rsu.c (293339)
1/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
2
3/*-
4 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18#include <sys/cdefs.h>
1/* $OpenBSD: if_rsu.c,v 1.17 2013/04/15 09:23:01 mglocker Exp $ */
2
3/*-
4 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18#include <sys/cdefs.h>
19__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_rsu.c 292080 2015-12-11 05:28:00Z imp $");
19__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_rsu.c 293339 2016-01-07 18:41:03Z avos $");
20
21/*
22 * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU.
23 *
24 * TODO:
25 * o h/w crypto
26 * o hostap / ibss / mesh
27 * o sensible RSSI levels

--- 370 unchanged lines hidden (view full) ---

398
399static int
400rsu_attach(device_t self)
401{
402 struct usb_attach_arg *uaa = device_get_ivars(self);
403 struct rsu_softc *sc = device_get_softc(self);
404 struct ieee80211com *ic = &sc->sc_ic;
405 int error;
20
21/*
22 * Driver for Realtek RTL8188SU/RTL8191SU/RTL8192SU.
23 *
24 * TODO:
25 * o h/w crypto
26 * o hostap / ibss / mesh
27 * o sensible RSSI levels

--- 370 unchanged lines hidden (view full) ---

398
399static int
400rsu_attach(device_t self)
401{
402 struct usb_attach_arg *uaa = device_get_ivars(self);
403 struct rsu_softc *sc = device_get_softc(self);
404 struct ieee80211com *ic = &sc->sc_ic;
405 int error;
406 uint8_t iface_index, bands;
406 uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
407 uint8_t iface_index;
407 struct usb_interface *iface;
408 const char *rft;
409
410 device_set_usb_desc(self);
411 sc->sc_udev = uaa->device;
412 sc->sc_dev = self;
413 if (rsu_enable_11n)
414 sc->sc_ht = !! (USB_GET_DRIVER_INFO(uaa) & RSU_HT_SUPPORTED);

--- 111 unchanged lines hidden (view full) ---

526 ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40;
527
528 /* set number of spatial streams */
529 ic->ic_txstream = sc->sc_ntxstream;
530 ic->ic_rxstream = sc->sc_nrxstream;
531 }
532
533 /* Set supported .11b and .11g rates. */
408 struct usb_interface *iface;
409 const char *rft;
410
411 device_set_usb_desc(self);
412 sc->sc_udev = uaa->device;
413 sc->sc_dev = self;
414 if (rsu_enable_11n)
415 sc->sc_ht = !! (USB_GET_DRIVER_INFO(uaa) & RSU_HT_SUPPORTED);

--- 111 unchanged lines hidden (view full) ---

527 ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40;
528
529 /* set number of spatial streams */
530 ic->ic_txstream = sc->sc_ntxstream;
531 ic->ic_rxstream = sc->sc_nrxstream;
532 }
533
534 /* Set supported .11b and .11g rates. */
534 bands = 0;
535 setbit(&bands, IEEE80211_MODE_11B);
536 setbit(&bands, IEEE80211_MODE_11G);
535 memset(bands, 0, sizeof(bands));
536 setbit(bands, IEEE80211_MODE_11B);
537 setbit(bands, IEEE80211_MODE_11G);
537 if (sc->sc_ht)
538 if (sc->sc_ht)
538 setbit(&bands, IEEE80211_MODE_11NG);
539 ieee80211_init_channels(ic, NULL, &bands);
539 setbit(bands, IEEE80211_MODE_11NG);
540 ieee80211_init_channels(ic, NULL, bands);
540
541 ieee80211_ifattach(ic);
542 ic->ic_raw_xmit = rsu_raw_xmit;
543 ic->ic_scan_start = rsu_scan_start;
544 ic->ic_scan_end = rsu_scan_end;
545 ic->ic_set_channel = rsu_set_channel;
546 ic->ic_vap_create = rsu_vap_create;
547 ic->ic_vap_delete = rsu_vap_delete;

--- 2395 unchanged lines hidden ---
541
542 ieee80211_ifattach(ic);
543 ic->ic_raw_xmit = rsu_raw_xmit;
544 ic->ic_scan_start = rsu_scan_start;
545 ic->ic_scan_end = rsu_scan_end;
546 ic->ic_set_channel = rsu_set_channel;
547 ic->ic_vap_create = rsu_vap_create;
548 ic->ic_vap_delete = rsu_vap_delete;

--- 2395 unchanged lines hidden ---