diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-11-26 11:14:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-11-26 11:14:24 +0000 |
commit | fc5e33634728bde6c974cd8aeff04d1c32f3aae9 (patch) | |
tree | 756cdd6a03627c0e603133d236612399bbf21458 /sys | |
parent | 11d67ff21f1bb2654684b406d4d681f9fa7fd0b2 (diff) |
do not have each net80211 driver define its own rates structures. if they use
the standard rates, use some defined by net80211 itself. kernel shrinks a bit
ok jsg mglocker
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/bcw.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/bcwvar.h | 9 | ||||
-rw-r--r-- | sys/dev/ic/malo.c | 12 | ||||
-rw-r--r-- | sys/dev/ic/rt2560.c | 15 | ||||
-rw-r--r-- | sys/dev/ic/rt2661.c | 20 | ||||
-rw-r--r-- | sys/dev/pci/if_bge.c | 56 | ||||
-rw-r--r-- | sys/dev/pci/if_ipw.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 17 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_ral.c | 15 | ||||
-rw-r--r-- | sys/dev/usb/if_rum.c | 20 | ||||
-rw-r--r-- | sys/dev/usb/if_uath.c | 15 | ||||
-rw-r--r-- | sys/dev/usb/if_zyd.c | 17 | ||||
-rw-r--r-- | sys/net80211/ieee80211.c | 11 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 6 |
15 files changed, 86 insertions, 160 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c index 6414d5f3275..264275ad0bc 100644 --- a/sys/dev/ic/bcw.c +++ b/sys/dev/ic/bcw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcw.c,v 1.6 2006/11/24 20:27:41 mglocker Exp $ */ +/* $OpenBSD: bcw.c,v 1.7 2006/11/26 11:14:17 deraadt Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -650,8 +650,8 @@ bcw_attach(struct bcw_softc *sc) printf(", address %s\n", ether_sprintf(ic->ic_myaddr)); /* Set supported rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = bcw_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = bcw_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* Set supported channels */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/ic/bcwvar.h b/sys/dev/ic/bcwvar.h index 189c1b3ee17..8250e8f3e41 100644 --- a/sys/dev/ic/bcwvar.h +++ b/sys/dev/ic/bcwvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bcwvar.h,v 1.5 2006/11/24 20:27:41 mglocker Exp $ */ +/* $OpenBSD: bcwvar.h,v 1.6 2006/11/26 11:14:17 deraadt Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -237,10 +237,3 @@ do { \ } while (/* CONSTCOND */ 0) #define BCW_NTXFRAGS 16 - -static const struct ieee80211_rateset bcw_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; -static const struct ieee80211_rateset bcw_rateset_11b = - { 4, { 2, 4, 11, 22 } }; -static const struct ieee80211_rateset bcw_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c index d1fa0c3e17b..acae293aa55 100644 --- a/sys/dev/ic/malo.c +++ b/sys/dev/ic/malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malo.c,v 1.38 2006/11/25 14:20:48 mglocker Exp $ */ +/* $OpenBSD: malo.c,v 1.39 2006/11/26 11:14:18 deraadt Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -283,12 +283,6 @@ int malo_cmd_set_txpower(struct malo_softc *sc, unsigned int powerlevel); int malo_cmd_set_rts(struct malo_softc *sc, uint32_t threshold); int malo_cmd_set_rate(struct malo_softc *sc, uint8_t rate); -/* supported rates */ -const struct ieee80211_rateset malo_rates_11b = - { 4, { 2, 4, 11, 22 } }; -const struct ieee80211_rateset malo_rates_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - int malo_intr(void *arg) { @@ -359,8 +353,8 @@ malo_attach(struct malo_softc *sc) IFQ_SET_READY(&ifp->if_snd); /* set supported rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = malo_rates_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = malo_rates_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; sc->sc_last_txrate = -1; /* set channels */ diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index f6e4c23e8e3..ce98c259ca4 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.26 2006/11/22 20:54:56 damien Exp $ */ +/* $OpenBSD: rt2560.c,v 1.27 2006/11/26 11:14:18 deraadt Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -147,15 +147,6 @@ int rt2560_init(struct ifnet *); void rt2560_stop(struct ifnet *, int); void rt2560_power(int, void *); -/* - * Supported rates for 802.11b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rt2560_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rt2560_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint32_t reg; uint32_t val; @@ -254,8 +245,8 @@ rt2560_attach(void *xsc, int id) IEEE80211_C_WEP; /* s/w WEP */ /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rt2560_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rt2560_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 205848824bb..d1d48462e3b 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.31 2006/11/13 20:06:38 damien Exp $ */ +/* $OpenBSD: rt2661.c,v 1.32 2006/11/26 11:14:18 deraadt Exp $ */ /*- * Copyright (c) 2006 @@ -156,18 +156,6 @@ int rt2661_get_rssi(struct rt2661_softc *, uint8_t); void rt2661_power(int, void *); void rt2661_shutdown(void *); -/* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rt2661_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset rt2661_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rt2661_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint32_t reg; uint32_t val; @@ -269,7 +257,7 @@ rt2661_attach(void *xsc, int id) if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = rt2661_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -290,8 +278,8 @@ rt2661_attach(void *xsc, int id) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rt2661_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rt2661_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 44407022bae..b0ce066fa56 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.196 2006/11/20 22:40:39 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.197 2006/11/26 11:14:21 deraadt Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -593,6 +593,10 @@ bge_alloc_jumbo_mem(struct bge_softc *sc) int i, rseg, state, error; struct bge_jpool_entry *entry; + /* Check to see if Jumbo memory is already allocated */ + if (sc->bge_cdata.bge_jumbo_buf) + return (0); + state = error = 0; /* Grab a big chunk o' storage. */ @@ -645,6 +649,7 @@ bge_alloc_jumbo_mem(struct bge_softc *sc) entry = malloc(sizeof(struct bge_jpool_entry), M_DEVBUF, M_NOWAIT); if (entry == NULL) { + sc->bge_cdata.bge_jumbo_buf = NULL; printf("%s: no memory for jumbo buffer queue!\n", sc->bge_dev.dv_xname); error = ENOBUFS; @@ -1222,6 +1227,7 @@ int bge_blockinit(struct bge_softc *sc) { volatile struct bge_rcb *rcb; + struct ifnet *ifp = &sc->arpcom.ac_if; vaddr_t rcb_addr; int i; bge_hostaddr taddr; @@ -1257,9 +1263,16 @@ bge_blockinit(struct bge_softc *sc) /* Configure mbuf pool watermarks */ /* new Broadcom docs strongly recommend these: */ if (!(BGE_IS_5705_OR_BEYOND(sc))) { - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50); - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20); - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60); + if (ifp->if_mtu > ETHER_MAX_LEN) { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60); + } else { + /* Values from Linux driver... */ + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 304); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 152); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 380); + } } else { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x10); @@ -1895,16 +1908,6 @@ bge_attach(struct device *parent, struct device *self, void *aux) bzero(sc->bge_rdata, sizeof(struct bge_ring_data)); - /* - * Try to allocate memory for Jumbo buffers. - */ - if (BGE_IS_JUMBO_CAPABLE(sc)) { - if (bge_alloc_jumbo_mem(sc)) { - printf(": jumbo buffer allocation failed\n"); - goto fail_5; - } - } - /* Set default tuneable values. */ sc->bge_stat_ticks = BGE_TICKS_PER_SEC; sc->bge_rx_coal_ticks = 150; @@ -2874,6 +2877,17 @@ bge_init(void *xsc) bge_chipinit(sc); /* + * Try to allocate memory for Jumbo buffers. + */ + if (BGE_IS_JUMBO_CAPABLE(sc) && ifp->if_mtu > ETHERMTU && + bge_alloc_jumbo_mem(sc)) { + printf("%s: jumbo buffer allocation failed\n", + sc->bge_dev.dv_xname); + splx(s); + return; + } + + /* * Init the various state machines, ring * control blocks and firmware. */ @@ -2886,12 +2900,8 @@ bge_init(void *xsc) ifp = &sc->arpcom.ac_if; /* Specify MRU. */ - if (BGE_IS_JUMBO_CAPABLE(sc)) - CSR_WRITE_4(sc, BGE_RX_MTU, - BGE_JUMBO_FRAMELEN + ETHER_VLAN_ENCAP_LEN); - else - CSR_WRITE_4(sc, BGE_RX_MTU, - ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); + CSR_WRITE_4(sc, BGE_RX_MTU, ifp->if_mtu + + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN); /* Load our MAC address. */ m = (u_int16_t *)&sc->arpcom.ac_enaddr[0]; @@ -2929,7 +2939,7 @@ bge_init(void *xsc) } /* Init Jumbo RX ring. */ - if (BGE_IS_JUMBO_CAPABLE(sc)) + if (BGE_IS_JUMBO_CAPABLE(sc) && ifp->if_mtu > ETHERMTU) bge_init_rx_ring_jumbo(sc); /* Init our RX return ring index */ @@ -3085,8 +3095,10 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFMTU: if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu) error = EINVAL; - else if (ifp->if_mtu != ifr->ifr_mtu) + else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; + bge_init(sc); + } break; case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index c2efcddbcbe..216352972a5 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.64 2006/10/23 18:19:26 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.65 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2004-2006 @@ -73,9 +73,6 @@ #include <dev/pci/if_ipwreg.h> #include <dev/pci/if_ipwvar.h> -static const struct ieee80211_rateset ipw_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - int ipw_match(struct device *, void *, void *); void ipw_attach(struct device *, struct device *, void *); void ipw_power(int, void *); @@ -253,7 +250,7 @@ ipw_attach(struct device *parent, struct device *self, void *aux) printf(", address %s\n", ether_sprintf(ic->ic_myaddr)); /* set supported .11b rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = ipw_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; /* set supported .11b channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 3b7c0498a12..7d6908936a2 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.77 2006/10/23 18:19:26 damien Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.78 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2004-2006 @@ -83,15 +83,6 @@ const struct pci_matchid iwi_devices[] = { { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_WL_2915ABG_2 } }; -static const struct ieee80211_rateset iwi_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset iwi_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset iwi_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - int iwi_match(struct device *, void *, void *); void iwi_attach(struct device *, struct device *, void *); void iwi_power(int, void *); @@ -301,7 +292,7 @@ iwi_attach(struct device *parent, struct device *self, void *aux) if (PCI_PRODUCT(pa->pa_id) >= PCI_PRODUCT_INTEL_PRO_WL_2915ABG_1) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = iwi_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -317,8 +308,8 @@ iwi_attach(struct device *parent, struct device *self, void *aux) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = iwi_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = iwi_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 8d5d6497f8a..feb616a5176 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.36 2006/11/13 20:06:38 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.37 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2006 @@ -69,18 +69,6 @@ const struct pci_matchid wpi_devices[] = { { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_WL_3945ABG_2 } }; -/* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset wpi_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset wpi_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset wpi_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const uint8_t wpi_ridx_to_plcp[] = { 0xd, 0xf, 0x5, 0x7, 0x9, 0xb, 0x1, 0x3, /* OFDM R1-R4 */ 10, 20, 55, 110 /* CCK */ @@ -290,7 +278,7 @@ wpi_attach(struct device *parent, struct device *self, void *aux) printf(", address %s\n", ether_sprintf(ic->ic_myaddr)); /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = wpi_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -310,8 +298,8 @@ wpi_attach(struct device *parent, struct device *self, void *aux) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = wpi_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = wpi_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 506caa91eb1..a0637f7555a 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.83 2006/11/19 16:44:36 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.84 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -173,15 +173,6 @@ Static void ural_amrr_timeout(void *); Static void ural_amrr_update(usbd_xfer_handle, usbd_private_handle, usbd_status status); -/* - * Supported rates for 802.11b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset ural_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset ural_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint16_t reg; uint16_t val; @@ -309,8 +300,8 @@ USB_ATTACH(ural) IEEE80211_C_WEP; /* s/w WEP */ /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = ural_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = ural_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 5a7ab77c989..e02c27b7229 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.44 2006/11/19 16:44:36 damien Exp $ */ +/* $OpenBSD: if_rum.c,v 1.45 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr> @@ -177,18 +177,6 @@ Static void rum_amrr_timeout(void *); Static void rum_amrr_update(usbd_xfer_handle, usbd_private_handle, usbd_status status); -/* - * Supported rates for 802.11a/b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset rum_rateset_11a = - { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; - -static const struct ieee80211_rateset rum_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset rum_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - static const struct { uint32_t reg; uint32_t val; @@ -355,7 +343,7 @@ USB_ATTACH(rum) if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = rum_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 34; i <= 46; i += 4) { @@ -381,8 +369,8 @@ USB_ATTACH(rum) } /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = rum_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = rum_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index 3a30a58d718..ae98cfd67b3 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.11 2006/10/03 19:48:21 damien Exp $ */ +/* $OpenBSD: if_uath.c,v 1.12 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2006 @@ -194,15 +194,6 @@ Static void uath_stop(struct ifnet *, int); Static int uath_loadfirmware(struct uath_softc *, const u_char *, int); Static int uath_activate(device_ptr_t, enum devact); -/* - * Supported rates for 802.11b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset uath_rateset_11b = - { 4, { 2, 4, 11, 22 } }; - -static const struct ieee80211_rateset uath_rateset_11g = - { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; - USB_DECLARE_DRIVER(uath); USB_MATCH(uath) @@ -369,8 +360,8 @@ USB_ATTACH(uath) IEEE80211_C_WEP; /* h/w WEP */ /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = uath_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = uath_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c index 1acb92189df..51a429979fe 100644 --- a/sys/dev/usb/if_zyd.c +++ b/sys/dev/usb/if_zyd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_zyd.c,v 1.37 2006/11/16 19:43:52 damien Exp $ */ +/* $OpenBSD: if_zyd.c,v 1.38 2006/11/26 11:14:22 deraadt Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr> @@ -187,17 +187,6 @@ void zyd_amrr_timeout(void *); void zyd_newassoc(struct ieee80211com *, struct ieee80211_node *, int); -/* - * Supported rates for 802.11b/g modes (in 500Kbps unit). - */ -static const struct ieee80211_rateset zyd_rateset_11b = { - 4, { 2, 4, 11, 22 } -}; - -static const struct ieee80211_rateset zyd_rateset_11g = { - 8, { 12, 18, 24, 36, 48, 72, 96, 108 } -}; - USB_MATCH(zyd) { USB_MATCH_START(zyd, uaa); @@ -337,8 +326,8 @@ zyd_complete_attach(struct zyd_softc *sc) IEEE80211_C_WEP; /* s/w WEP */ /* set supported .11b and .11g rates */ - ic->ic_sup_rates[IEEE80211_MODE_11B] = zyd_rateset_11b; - ic->ic_sup_rates[IEEE80211_MODE_11G] = zyd_rateset_11g; + ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = ieee80211_std_rateset_11g; /* set supported .11b and .11g channels (1 through 14) */ for (i = 1; i <= 14; i++) { diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 2e1c684ec44..75f535fc3ed 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.c,v 1.17 2006/06/18 18:39:41 damien Exp $ */ +/* $OpenBSD: ieee80211.c,v 1.18 2006/11/26 11:14:23 deraadt Exp $ */ /* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */ /*- @@ -603,6 +603,15 @@ ieee80211_watchdog(struct ifnet *ifp) ifp->if_timer = 1; } +struct ieee80211_rateset ieee80211_std_rateset_11a = + { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; + +struct ieee80211_rateset ieee80211_std_rateset_11b = + { 4, { 2, 4, 11, 22 } }; + +struct ieee80211_rateset ieee80211_std_rateset_11g = + { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; + /* * Mark the basic rates for the 11g rate table based on the * operating mode. For real 11g we mark all the 11b rates diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 325225a8528..55c13f9c813 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.h,v 1.9 2006/06/18 18:39:41 damien Exp $ */ +/* $OpenBSD: ieee80211_node.h,v 1.10 2006/11/26 11:14:23 deraadt Exp $ */ /* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */ /*- @@ -48,6 +48,10 @@ struct ieee80211_rateset { u_int8_t rs_rates[IEEE80211_RATE_MAXSIZE]; }; +extern struct ieee80211_rateset ieee80211_std_rateset_11a; +extern struct ieee80211_rateset ieee80211_std_rateset_11b; +extern struct ieee80211_rateset ieee80211_std_rateset_11g; + enum ieee80211_node_state { IEEE80211_STA_CACHE, /* cached node */ IEEE80211_STA_BSS, /* ic->ic_bss, the network we joined */ |