From owner-p4-projects@FreeBSD.ORG Fri Nov 14 09:12:17 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 47E7E16A4D1; Fri, 14 Nov 2003 09:12:17 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2262B16A4CF for ; Fri, 14 Nov 2003 09:12:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 767A043FAF for ; Fri, 14 Nov 2003 09:12:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAEHCGXJ051461 for ; Fri, 14 Nov 2003 09:12:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAEHCFw7051458 for perforce@freebsd.org; Fri, 14 Nov 2003 09:12:15 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 14 Nov 2003 09:12:15 -0800 (PST) Message-Id: <200311141712.hAEHCFw7051458@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 42339 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2003 17:12:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=42339 Change 42339 by sam@sam_ebb on 2003/11/14 09:11:13 mods for forthcoming hal api changes Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#35 edit .. //depot/projects/netperf/sys/dev/ath/if_athioctl.h#6 edit .. //depot/projects/netperf/sys/dev/ath/if_athvar.h#7 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#35 (text+ko) ==== @@ -898,8 +898,25 @@ ath_mode_init(sc); break; case SIOCGATHSTATS: - copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); + error = copyout(&sc->sc_stats, + ifr->ifr_data, sizeof (sc->sc_stats)); + break; + case SIOCGATHDIAG: { + struct ath_diag *ad = (struct ath_diag *)data; + struct ath_hal *ah = sc->sc_ah; + void *data; + u_int size; + + if (ath_hal_getdiagstate(ah, ad->ad_id, &data, &size)) { + if (size > ad->ad_size) + size = ad->ad_size; + error = copyout(data, ad->ad_data, size); + if (error == 0) + ad->ad_size = size; + } else + error = EINVAL; break; + } default: error = ieee80211_ioctl(ifp, cmd, data); if (error == ENETRESET) { @@ -2772,12 +2789,6 @@ sc = ifp->if_softc; if (strcmp(dmode, "hal") == 0) ath_hal_dumpstate(sc->sc_ah); - else if (strcmp(dmode, "eeprom") == 0) - ath_hal_dumpeeprom(sc->sc_ah); - else if (strcmp(dmode, "rfgain") == 0) - ath_hal_dumprfgain(sc->sc_ah); - else if (strcmp(dmode, "ani") == 0) - ath_hal_dumpani(sc->sc_ah); else return EINVAL; } ==== //depot/projects/netperf/sys/dev/ath/if_athioctl.h#6 (text+ko) ==== @@ -91,6 +91,15 @@ #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) +struct ath_diag { + char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ + u_int ad_id; + caddr_t ad_data; + u_int ad_size; + +}; +#define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag) + /* * Radio capture format. */ ==== //depot/projects/netperf/sys/dev/ath/if_athvar.h#7 (text+ko) ==== @@ -274,12 +274,8 @@ ((*(_ah)->ah_stopDmaReceive)((_ah))) #define ath_hal_dumpstate(_ah) \ ((*(_ah)->ah_dumpState)((_ah))) -#define ath_hal_dumpeeprom(_ah) \ - ((*(_ah)->ah_dumpEeprom)((_ah))) -#define ath_hal_dumprfgain(_ah) \ - ((*(_ah)->ah_dumpRfGain)((_ah))) -#define ath_hal_dumpani(_ah) \ - ((*(_ah)->ah_dumpAni)((_ah))) +#define ath_hal_getdiagstate(_ah, _id, _data, _size) \ + ((*(_ah)->ah_getDiagState)((_ah), (_id), (_data), (_size))) #define ath_hal_setuptxqueue(_ah, _type, _irq) \ ((*(_ah)->ah_setupTxQueue)((_ah), (_type), (_irq))) #define ath_hal_resettxqueue(_ah, _q) \