ar5210_misc.c (235206) | ar5210_misc.c (243317) |
---|---|
1/* 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2004 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * | 1/* 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2004 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * |
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c 235206 2012-05-09 18:17:01Z adrian $ | 17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c 243317 2012-11-19 23:42:46Z adrian $ |
18 */ 19#include "opt_ah.h" 20 21#include "ah.h" 22#include "ah_internal.h" 23 24#include "ar5210/ar5210.h" 25#include "ar5210/ar5210reg.h" --- 545 unchanged lines hidden (view full) --- 571{ 572} 573 574void 575ar5210MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats) 576{ 577} 578 | 18 */ 19#include "opt_ah.h" 20 21#include "ah.h" 22#include "ah_internal.h" 23 24#include "ar5210/ar5210.h" 25#include "ar5210/ar5210reg.h" --- 545 unchanged lines hidden (view full) --- 571{ 572} 573 574void 575ar5210MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats) 576{ 577} 578 |
579#define AR_DIAG_SW_DIS_CRYPTO (AR_DIAG_SW_DIS_ENC | AR_DIAG_SW_DIS_DEC) 580 | |
581HAL_STATUS 582ar5210GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, 583 uint32_t capability, uint32_t *result) 584{ 585 586 switch (type) { 587 case HAL_CAP_CIPHER: /* cipher handled in hardware */ | 579HAL_STATUS 580ar5210GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, 581 uint32_t capability, uint32_t *result) 582{ 583 584 switch (type) { 585 case HAL_CAP_CIPHER: /* cipher handled in hardware */ |
586#if 0 |
|
588 return (capability == HAL_CIPHER_WEP ? HAL_OK : HAL_ENOTSUPP); | 587 return (capability == HAL_CIPHER_WEP ? HAL_OK : HAL_ENOTSUPP); |
588#else 589 return HAL_ENOTSUPP; 590#endif |
|
589 default: 590 return ath_hal_getcapability(ah, type, capability, result); 591 } 592} 593 594HAL_BOOL 595ar5210SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, 596 uint32_t capability, uint32_t setting, HAL_STATUS *status) --- 6 unchanged lines hidden (view full) --- 603 * (e.g. 1 => ACK, 2 => CTS, etc.) but it hardly 604 * seems worth the additional complexity. 605 */ 606#ifdef AH_DEBUG 607 AH_PRIVATE(ah)->ah_diagreg = setting; 608#else 609 AH_PRIVATE(ah)->ah_diagreg = setting & 0x6; /* ACK+CTS */ 610#endif | 591 default: 592 return ath_hal_getcapability(ah, type, capability, result); 593 } 594} 595 596HAL_BOOL 597ar5210SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, 598 uint32_t capability, uint32_t setting, HAL_STATUS *status) --- 6 unchanged lines hidden (view full) --- 605 * (e.g. 1 => ACK, 2 => CTS, etc.) but it hardly 606 * seems worth the additional complexity. 607 */ 608#ifdef AH_DEBUG 609 AH_PRIVATE(ah)->ah_diagreg = setting; 610#else 611 AH_PRIVATE(ah)->ah_diagreg = setting & 0x6; /* ACK+CTS */ 612#endif |
611 OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg); | 613 ar5210UpdateDiagReg(ah, AH_PRIVATE(ah)->ah_diagreg); |
612 return AH_TRUE; 613 case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ 614 return AH_FALSE; /* NB: disallow */ 615 default: 616 return ath_hal_setcapability(ah, type, capability, 617 setting, status); 618 } 619} --- 52 unchanged lines hidden (view full) --- 672ar5210EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) 673{ 674} 675 676void 677ar5210GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) 678{ 679} | 614 return AH_TRUE; 615 case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */ 616 return AH_FALSE; /* NB: disallow */ 617 default: 618 return ath_hal_setcapability(ah, type, capability, 619 setting, status); 620 } 621} --- 52 unchanged lines hidden (view full) --- 674ar5210EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) 675{ 676} 677 678void 679ar5210GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) 680{ 681} |
682 683/* 684 * Update the diagnostic register. 685 * 686 * This merges in the diagnostic register setting with the default 687 * value, which may or may not involve disabling hardware encryption. 688 */ 689void 690ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val) 691{ 692 693 /* Disable all hardware encryption */ 694 val |= AR_DIAG_SW_DIS_CRYPTO; 695 OS_REG_WRITE(ah, AR_DIAG_SW, val); 696} |
|