003 File Manager
Current Path:
/usr/src/sys/dev/ath
usr
/
src
/
sys
/
dev
/
ath
/
📁
..
📄
ah_osdep.c
(12.15 KB)
📄
ah_osdep.h
(5.25 KB)
📄
ah_osdep_ar5210.c
(2.18 KB)
📄
ah_osdep_ar5211.c
(2.18 KB)
📄
ah_osdep_ar5212.c
(2.87 KB)
📄
ah_osdep_ar5416.c
(3.17 KB)
📄
ah_osdep_ar9300.c
(2.18 KB)
📁
ath_dfs
📁
ath_hal
📁
ath_rate
📄
if_ath.c
(188.12 KB)
📄
if_ath_ahb.c
(8.97 KB)
📄
if_ath_alq.c
(5.01 KB)
📄
if_ath_alq.h
(5.41 KB)
📄
if_ath_beacon.c
(34.09 KB)
📄
if_ath_beacon.h
(2.46 KB)
📄
if_ath_btcoex.c
(12.1 KB)
📄
if_ath_btcoex.h
(1.94 KB)
📄
if_ath_btcoex_mci.c
(19.32 KB)
📄
if_ath_btcoex_mci.h
(1.87 KB)
📄
if_ath_debug.c
(8.25 KB)
📄
if_ath_debug.h
(5.09 KB)
📄
if_ath_descdma.c
(11.93 KB)
📄
if_ath_descdma.h
(2.1 KB)
📄
if_ath_dfs.c
(2.24 KB)
📄
if_ath_drv.c
(2.73 KB)
📄
if_ath_ioctl.c
(8.17 KB)
📄
if_ath_ioctl.h
(1.61 KB)
📄
if_ath_keycache.c
(15.25 KB)
📄
if_ath_keycache.h
(1.99 KB)
📄
if_ath_led.c
(5.34 KB)
📄
if_ath_led.h
(1.69 KB)
📄
if_ath_lna_div.c
(29.12 KB)
📄
if_ath_lna_div.h
(3.18 KB)
📄
if_ath_misc.h
(5.35 KB)
📄
if_ath_pci.c
(9.83 KB)
📄
if_ath_pci_devlist.h
(18.79 KB)
📄
if_ath_rate.c
(2.25 KB)
📄
if_ath_rx.c
(44.12 KB)
📄
if_ath_rx.h
(2.75 KB)
📄
if_ath_rx_edma.c
(24.79 KB)
📄
if_ath_rx_edma.h
(1.65 KB)
📄
if_ath_spectral.c
(7.5 KB)
📄
if_ath_spectral.h
(1.89 KB)
📄
if_ath_sysctl.c
(44.28 KB)
📄
if_ath_sysctl.h
(1.75 KB)
📄
if_ath_tdma.c
(21.88 KB)
📄
if_ath_tdma.h
(2.46 KB)
📄
if_ath_tsf.h
(2.73 KB)
📄
if_ath_tx.c
(171.9 KB)
📄
if_ath_tx.h
(6.09 KB)
📄
if_ath_tx_edma.c
(27.82 KB)
📄
if_ath_tx_edma.h
(1.65 KB)
📄
if_ath_tx_ht.c
(29 KB)
📄
if_ath_tx_ht.h
(2.19 KB)
📄
if_athdfs.h
(2.3 KB)
📄
if_athioctl.h
(16.2 KB)
📄
if_athrate.h
(6.82 KB)
📄
if_athvar.h
(58.81 KB)
Editing: if_ath_alq.c
/*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012 Adrian Chadd * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any * redistribution must be conditioned upon including a substantially * similar Disclaimer requirement for further binary redistribution. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. * * $FreeBSD$ */ #include "opt_ah.h" #include "opt_ath.h" #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/sysctl.h> #include <sys/bus.h> #include <sys/malloc.h> #include <sys/proc.h> #include <sys/pcpu.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/alq.h> #include <sys/endian.h> #include <sys/time.h> #include <dev/ath/if_ath_alq.h> #ifdef ATH_DEBUG_ALQ static struct ale * if_ath_alq_get(struct if_ath_alq *alq, int len) { struct ale *ale; if (alq->sc_alq_isactive == 0) return (NULL); ale = alq_getn(alq->sc_alq_alq, len, ALQ_NOWAIT); if (! ale) alq->sc_alq_numlost++; return (ale); } void if_ath_alq_init(struct if_ath_alq *alq, const char *devname) { bzero(alq, sizeof(*alq)); strncpy(alq->sc_alq_devname, devname, ATH_ALQ_DEVNAME_LEN); printf("%s (%s): attached\n", __func__, alq->sc_alq_devname); snprintf(alq->sc_alq_filename, ATH_ALQ_FILENAME_LEN, "/tmp/ath_%s_alq.log", alq->sc_alq_devname); /* XXX too conservative, right? */ alq->sc_alq_qsize = (64*1024); } void if_ath_alq_setcfg(struct if_ath_alq *alq, uint32_t macVer, uint32_t macRev, uint32_t phyRev, uint32_t halMagic) { /* Store these in network order */ alq->sc_alq_cfg.sc_mac_version = htobe32(macVer); alq->sc_alq_cfg.sc_mac_revision = htobe32(macRev); alq->sc_alq_cfg.sc_phy_rev = htobe32(phyRev); alq->sc_alq_cfg.sc_hal_magic = htobe32(halMagic); } void if_ath_alq_tidyup(struct if_ath_alq *alq) { if_ath_alq_stop(alq); printf("%s (%s): detached\n", __func__, alq->sc_alq_devname); bzero(alq, sizeof(*alq)); } int if_ath_alq_start(struct if_ath_alq *alq) { int error; if (alq->sc_alq_isactive) return (0); /* * Create a variable-length ALQ. */ error = alq_open(&alq->sc_alq_alq, alq->sc_alq_filename, curthread->td_ucred, ALQ_DEFAULT_CMODE, alq->sc_alq_qsize, 0); if (error != 0) { printf("%s (%s): failed, err=%d\n", __func__, alq->sc_alq_devname, error); } else { printf("%s (%s): opened\n", __func__, alq->sc_alq_devname); alq->sc_alq_isactive = 1; if_ath_alq_post(alq, ATH_ALQ_INIT_STATE, sizeof (struct if_ath_alq_init_state), (char *) &alq->sc_alq_cfg); } return (error); } int if_ath_alq_stop(struct if_ath_alq *alq) { if (alq->sc_alq_isactive == 0) return (0); printf("%s (%s): closed\n", __func__, alq->sc_alq_devname); alq->sc_alq_isactive = 0; alq_close(alq->sc_alq_alq); alq->sc_alq_alq = NULL; return (0); } /* * Post a debug message to the ALQ. * * "len" is the size of the buf payload in bytes. */ void if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len, const char *buf) { struct if_ath_alq_hdr *ap; struct ale *ale; struct timeval tv; if (! if_ath_alq_checkdebug(alq, op)) return; microtime(&tv); /* * Enforce some semblence of sanity on 'len'. * Although strictly speaking, any length is possible - * just be conservative so things don't get out of hand. */ if (len > ATH_ALQ_PAYLOAD_LEN) len = ATH_ALQ_PAYLOAD_LEN; ale = if_ath_alq_get(alq, len + sizeof(struct if_ath_alq_hdr)); if (ale == NULL) return; ap = (struct if_ath_alq_hdr *) ale->ae_data; ap->threadid = htobe64((uint64_t) curthread->td_tid); ap->tstamp_sec = htobe32((uint32_t) tv.tv_sec); ap->tstamp_usec = htobe32((uint32_t) tv.tv_usec); ap->op = htobe16(op); ap->len = htobe16(len); /* * Copy the payload _after_ the header field. */ if (buf != NULL) { memcpy(((char *) ap) + sizeof(struct if_ath_alq_hdr), buf, len); } alq_post(alq->sc_alq_alq, ale); } #endif /* ATH_DEBUG */
Upload File
Create Folder