diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 48 | ||||
-rw-r--r-- | sys/dev/pci/if_ipwvar.h | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 45 | ||||
-rw-r--r-- | sys/dev/pci/if_iwivar.h | 5 |
4 files changed, 22 insertions, 81 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 4806bd82148..d4b94eeafcc 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.41 2005/02/19 13:08:55 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.42 2005/02/21 13:33:29 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -1413,38 +1413,9 @@ ipw_watchdog(struct ifnet *ifp) } int -ipw_get_table1(struct ipw_softc *sc, u_int32_t *tbl) -{ - u_int32_t i, size, buf[256]; - - if (!(sc->flags & IPW_FLAG_FW_INITED)) { - bzero(buf, sizeof buf); - return copyout(buf, tbl, sizeof buf); - } - - CSR_WRITE_4(sc, IPW_CSR_AUTOINC_ADDR, sc->table1_base); - - size = min(CSR_READ_4(sc, IPW_CSR_AUTOINC_DATA), 256); - for (i = 1; i < size; i++) - buf[i] = MEM_READ_4(sc, CSR_READ_4(sc, IPW_CSR_AUTOINC_DATA)); - - return copyout(buf, tbl, sizeof buf); -} - -int -ipw_get_radio(struct ipw_softc *sc, int *ret) -{ - int val; - - val = (CSR_READ_4(sc, IPW_CSR_IO) & IPW_IO_RADIO_DISABLED) ? 0 : 1; - return copyout(&val, ret, sizeof val); -} - -int ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ipw_softc *sc = ifp->if_softc; - struct ifreq *ifr; struct ifaddr *ifa; int s, error = 0; @@ -1476,14 +1447,15 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; - case SIOCGTABLE1: - ifr = (struct ifreq *)data; - error = ipw_get_table1(sc, (u_int32_t *)ifr->ifr_data); - break; - - case SIOCGRADIO: - ifr = (struct ifreq *)data; - error = ipw_get_radio(sc, (int *)ifr->ifr_data); + case SIOCG80211TXPOWER: + /* + * If the hardware radio transmitter switch is off, report a + * tx power of IEEE80211_TXPOWER_MIN to indicate that radio + * transmitter is killed. + */ + ((struct ieee80211_txpower *)data)->i_val = + (CSR_READ_4(sc, IPW_CSR_IO) & IPW_IO_RADIO_DISABLED) ? + IEEE80211_TXPOWER_MIN : sc->sc_ic.ic_txpower; break; case SIOCG80211AUTH: diff --git a/sys/dev/pci/if_ipwvar.h b/sys/dev/pci/if_ipwvar.h index fe95d7383b5..6e565cfd46f 100644 --- a/sys/dev/pci/if_ipwvar.h +++ b/sys/dev/pci/if_ipwvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipwvar.h,v 1.8 2005/01/13 20:52:13 damien Exp $ */ +/* $OpenBSD: if_ipwvar.h,v 1.9 2005/02/21 13:33:29 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -161,6 +161,3 @@ struct ipw_softc { int sc_txtap_len; #endif }; - -#define SIOCGRADIO _IOWR('i', 139, struct ifreq) -#define SIOCGTABLE1 _IOWR('i', 140, struct ifreq) diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index cc49fdc69b7..029ae7ae92d 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.26 2005/02/19 13:38:01 damien Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.27 2005/02/21 13:33:29 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -1249,35 +1249,9 @@ iwi_watchdog(struct ifnet *ifp) } int -iwi_get_table0(struct iwi_softc *sc, u_int32_t *tbl) -{ - u_int32_t size, buf[128]; - - if (!(sc->flags & IWI_FLAG_FW_INITED)) { - bzero(buf, sizeof buf); - return copyout(buf, tbl, sizeof buf); - } - - size = min(CSR_READ_4(sc, IWI_CSR_TABLE0_SIZE), 128 - 1); - CSR_READ_REGION_4(sc, IWI_CSR_TABLE0_BASE, &buf[1], size); - - return copyout(buf, tbl, sizeof buf); -} - -int -iwi_get_radio(struct iwi_softc *sc, int *ret) -{ - int val; - - val = (CSR_READ_4(sc, IWI_CSR_IO) & IWI_IO_RADIO_ENABLED) ? 1 : 0; - return copyout(&val, ret, sizeof val); -} - -int iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct iwi_softc *sc = ifp->if_softc; - struct ifreq *ifr; struct ifaddr *ifa; int s, error = 0; @@ -1310,14 +1284,15 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; - case SIOCGTABLE0: - ifr = (struct ifreq *)data; - error = iwi_get_table0(sc, (u_int32_t *)ifr->ifr_data); - break; - - case SIOCGRADIO: - ifr = (struct ifreq *)data; - error = iwi_get_radio(sc, (int *)ifr->ifr_data); + case SIOCG80211TXPOWER: + /* + * If the hardware radio transmitter switch is off, report a + * tx power of IEEE80211_TXPOWER_MIN to indicate that radio + * transmitter is killed. + */ + ((struct ieee80211_txpower *)data)->i_val = + (CSR_READ_4(sc, IWI_CSR_IO) & IWI_IO_RADIO_ENABLED) ? + sc->sc_ic.ic_txpower : IEEE80211_TXPOWER_MIN; break; case SIOCG80211AUTH: diff --git a/sys/dev/pci/if_iwivar.h b/sys/dev/pci/if_iwivar.h index 24a0293a0e4..e4c35848f3a 100644 --- a/sys/dev/pci/if_iwivar.h +++ b/sys/dev/pci/if_iwivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwivar.h,v 1.6 2005/01/09 16:47:50 damien Exp $ */ +/* $OpenBSD: if_iwivar.h,v 1.7 2005/02/21 13:33:29 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -128,6 +128,3 @@ struct iwi_softc { int sc_txtap_len; #endif }; - -#define SIOCGRADIO _IOWR('i', 139, struct ifreq) -#define SIOCGTABLE0 _IOWR('i', 140, struct ifreq) |