18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2010 Broadcom Corporation 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 118c2ecf20Sopenharmony_ci * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 138c2ecf20Sopenharmony_ci * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 148c2ecf20Sopenharmony_ci * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#ifndef _BRCM_D11_H_ 188c2ecf20Sopenharmony_ci#define _BRCM_D11_H_ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include <linux/ieee80211.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#include <defs.h> 238c2ecf20Sopenharmony_ci#include "pub.h" 248c2ecf20Sopenharmony_ci#include "dma.h" 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* RX FIFO numbers */ 278c2ecf20Sopenharmony_ci#define RX_FIFO 0 /* data and ctl frames */ 288c2ecf20Sopenharmony_ci#define RX_TXSTATUS_FIFO 3 /* RX fifo for tx status packages */ 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* TX FIFO numbers using WME Access Category */ 318c2ecf20Sopenharmony_ci#define TX_AC_BK_FIFO 0 /* Background TX FIFO */ 328c2ecf20Sopenharmony_ci#define TX_AC_BE_FIFO 1 /* Best-Effort TX FIFO */ 338c2ecf20Sopenharmony_ci#define TX_AC_VI_FIFO 2 /* Video TX FIFO */ 348c2ecf20Sopenharmony_ci#define TX_AC_VO_FIFO 3 /* Voice TX FIFO */ 358c2ecf20Sopenharmony_ci#define TX_BCMC_FIFO 4 /* Broadcast/Multicast TX FIFO */ 368c2ecf20Sopenharmony_ci#define TX_ATIM_FIFO 5 /* TX fifo for ATIM window info */ 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci/* Addr is byte address used by SW; offset is word offset used by uCode */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* Per AC TX limit settings */ 418c2ecf20Sopenharmony_ci#define M_AC_TXLMT_BASE_ADDR (0x180 * 2) 428c2ecf20Sopenharmony_ci#define M_AC_TXLMT_ADDR(_ac) (M_AC_TXLMT_BASE_ADDR + (2 * (_ac))) 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci/* Legacy TX FIFO numbers */ 458c2ecf20Sopenharmony_ci#define TX_DATA_FIFO TX_AC_BE_FIFO 468c2ecf20Sopenharmony_ci#define TX_CTL_FIFO TX_AC_VO_FIFO 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define WL_RSSI_ANT_MAX 4 /* max possible rx antennas */ 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistruct intctrlregs { 518c2ecf20Sopenharmony_ci u32 intstatus; 528c2ecf20Sopenharmony_ci u32 intmask; 538c2ecf20Sopenharmony_ci}; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci/* PIO structure, 568c2ecf20Sopenharmony_ci * support two PIO format: 2 bytes access and 4 bytes access 578c2ecf20Sopenharmony_ci * basic FIFO register set is per channel(transmit or receive) 588c2ecf20Sopenharmony_ci * a pair of channels is defined for convenience 598c2ecf20Sopenharmony_ci */ 608c2ecf20Sopenharmony_ci/* 2byte-wide pio register set per channel(xmt or rcv) */ 618c2ecf20Sopenharmony_cistruct pio2regs { 628c2ecf20Sopenharmony_ci u16 fifocontrol; 638c2ecf20Sopenharmony_ci u16 fifodata; 648c2ecf20Sopenharmony_ci u16 fifofree; /* only valid in xmt channel, not in rcv channel */ 658c2ecf20Sopenharmony_ci u16 PAD; 668c2ecf20Sopenharmony_ci}; 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ci/* a pair of pio channels(tx and rx) */ 698c2ecf20Sopenharmony_cistruct pio2regp { 708c2ecf20Sopenharmony_ci struct pio2regs tx; 718c2ecf20Sopenharmony_ci struct pio2regs rx; 728c2ecf20Sopenharmony_ci}; 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci/* 4byte-wide pio register set per channel(xmt or rcv) */ 758c2ecf20Sopenharmony_cistruct pio4regs { 768c2ecf20Sopenharmony_ci u32 fifocontrol; 778c2ecf20Sopenharmony_ci u32 fifodata; 788c2ecf20Sopenharmony_ci}; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* a pair of pio channels(tx and rx) */ 818c2ecf20Sopenharmony_cistruct pio4regp { 828c2ecf20Sopenharmony_ci struct pio4regs tx; 838c2ecf20Sopenharmony_ci struct pio4regs rx; 848c2ecf20Sopenharmony_ci}; 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci/* read: 32-bit register that can be read as 32-bit or as 2 16-bit 878c2ecf20Sopenharmony_ci * write: only low 16b-it half can be written 888c2ecf20Sopenharmony_ci */ 898c2ecf20Sopenharmony_ciunion pmqreg { 908c2ecf20Sopenharmony_ci u32 pmqhostdata; /* read only! */ 918c2ecf20Sopenharmony_ci struct { 928c2ecf20Sopenharmony_ci u16 pmqctrlstatus; /* read/write */ 938c2ecf20Sopenharmony_ci u16 PAD; 948c2ecf20Sopenharmony_ci } w; 958c2ecf20Sopenharmony_ci}; 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_cistruct fifo64 { 988c2ecf20Sopenharmony_ci struct dma64regs dmaxmt; /* dma tx */ 998c2ecf20Sopenharmony_ci struct pio4regs piotx; /* pio tx */ 1008c2ecf20Sopenharmony_ci struct dma64regs dmarcv; /* dma rx */ 1018c2ecf20Sopenharmony_ci struct pio4regs piorx; /* pio rx */ 1028c2ecf20Sopenharmony_ci}; 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci/* 1058c2ecf20Sopenharmony_ci * Host Interface Registers 1068c2ecf20Sopenharmony_ci */ 1078c2ecf20Sopenharmony_cistruct d11regs { 1088c2ecf20Sopenharmony_ci /* Device Control ("semi-standard host registers") */ 1098c2ecf20Sopenharmony_ci u32 PAD[3]; /* 0x0 - 0x8 */ 1108c2ecf20Sopenharmony_ci u32 biststatus; /* 0xC */ 1118c2ecf20Sopenharmony_ci u32 biststatus2; /* 0x10 */ 1128c2ecf20Sopenharmony_ci u32 PAD; /* 0x14 */ 1138c2ecf20Sopenharmony_ci u32 gptimer; /* 0x18 */ 1148c2ecf20Sopenharmony_ci u32 usectimer; /* 0x1c *//* for corerev >= 26 */ 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci /* Interrupt Control *//* 0x20 */ 1178c2ecf20Sopenharmony_ci struct intctrlregs intctrlregs[8]; 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci u32 PAD[40]; /* 0x60 - 0xFC */ 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci u32 intrcvlazy[4]; /* 0x100 - 0x10C */ 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci u32 PAD[4]; /* 0x110 - 0x11c */ 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci u32 maccontrol; /* 0x120 */ 1268c2ecf20Sopenharmony_ci u32 maccommand; /* 0x124 */ 1278c2ecf20Sopenharmony_ci u32 macintstatus; /* 0x128 */ 1288c2ecf20Sopenharmony_ci u32 macintmask; /* 0x12C */ 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci /* Transmit Template Access */ 1318c2ecf20Sopenharmony_ci u32 tplatewrptr; /* 0x130 */ 1328c2ecf20Sopenharmony_ci u32 tplatewrdata; /* 0x134 */ 1338c2ecf20Sopenharmony_ci u32 PAD[2]; /* 0x138 - 0x13C */ 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ci /* PMQ registers */ 1368c2ecf20Sopenharmony_ci union pmqreg pmqreg; /* 0x140 */ 1378c2ecf20Sopenharmony_ci u32 pmqpatl; /* 0x144 */ 1388c2ecf20Sopenharmony_ci u32 pmqpath; /* 0x148 */ 1398c2ecf20Sopenharmony_ci u32 PAD; /* 0x14C */ 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_ci u32 chnstatus; /* 0x150 */ 1428c2ecf20Sopenharmony_ci u32 psmdebug; /* 0x154 */ 1438c2ecf20Sopenharmony_ci u32 phydebug; /* 0x158 */ 1448c2ecf20Sopenharmony_ci u32 machwcap; /* 0x15C */ 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci /* Extended Internal Objects */ 1478c2ecf20Sopenharmony_ci u32 objaddr; /* 0x160 */ 1488c2ecf20Sopenharmony_ci u32 objdata; /* 0x164 */ 1498c2ecf20Sopenharmony_ci u32 PAD[2]; /* 0x168 - 0x16c */ 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci u32 frmtxstatus; /* 0x170 */ 1528c2ecf20Sopenharmony_ci u32 frmtxstatus2; /* 0x174 */ 1538c2ecf20Sopenharmony_ci u32 PAD[2]; /* 0x178 - 0x17c */ 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci /* TSF host access */ 1568c2ecf20Sopenharmony_ci u32 tsf_timerlow; /* 0x180 */ 1578c2ecf20Sopenharmony_ci u32 tsf_timerhigh; /* 0x184 */ 1588c2ecf20Sopenharmony_ci u32 tsf_cfprep; /* 0x188 */ 1598c2ecf20Sopenharmony_ci u32 tsf_cfpstart; /* 0x18c */ 1608c2ecf20Sopenharmony_ci u32 tsf_cfpmaxdur32; /* 0x190 */ 1618c2ecf20Sopenharmony_ci u32 PAD[3]; /* 0x194 - 0x19c */ 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci u32 maccontrol1; /* 0x1a0 */ 1648c2ecf20Sopenharmony_ci u32 machwcap1; /* 0x1a4 */ 1658c2ecf20Sopenharmony_ci u32 PAD[14]; /* 0x1a8 - 0x1dc */ 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci /* Clock control and hardware workarounds*/ 1688c2ecf20Sopenharmony_ci u32 clk_ctl_st; /* 0x1e0 */ 1698c2ecf20Sopenharmony_ci u32 hw_war; 1708c2ecf20Sopenharmony_ci u32 d11_phypllctl; /* the phypll request/avail bits are 1718c2ecf20Sopenharmony_ci * moved to clk_ctl_st 1728c2ecf20Sopenharmony_ci */ 1738c2ecf20Sopenharmony_ci u32 PAD[5]; /* 0x1ec - 0x1fc */ 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci /* 0x200-0x37F dma/pio registers */ 1768c2ecf20Sopenharmony_ci struct fifo64 fifo64regs[6]; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci /* FIFO diagnostic port access */ 1798c2ecf20Sopenharmony_ci struct dma32diag dmafifo; /* 0x380 - 0x38C */ 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci u32 aggfifocnt; /* 0x390 */ 1828c2ecf20Sopenharmony_ci u32 aggfifodata; /* 0x394 */ 1838c2ecf20Sopenharmony_ci u32 PAD[16]; /* 0x398 - 0x3d4 */ 1848c2ecf20Sopenharmony_ci u16 radioregaddr; /* 0x3d8 */ 1858c2ecf20Sopenharmony_ci u16 radioregdata; /* 0x3da */ 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci /* 1888c2ecf20Sopenharmony_ci * time delay between the change on rf disable input and 1898c2ecf20Sopenharmony_ci * radio shutdown 1908c2ecf20Sopenharmony_ci */ 1918c2ecf20Sopenharmony_ci u32 rfdisabledly; /* 0x3DC */ 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci /* PHY register access */ 1948c2ecf20Sopenharmony_ci u16 phyversion; /* 0x3e0 - 0x0 */ 1958c2ecf20Sopenharmony_ci u16 phybbconfig; /* 0x3e2 - 0x1 */ 1968c2ecf20Sopenharmony_ci u16 phyadcbias; /* 0x3e4 - 0x2 Bphy only */ 1978c2ecf20Sopenharmony_ci u16 phyanacore; /* 0x3e6 - 0x3 pwwrdwn on aphy */ 1988c2ecf20Sopenharmony_ci u16 phyrxstatus0; /* 0x3e8 - 0x4 */ 1998c2ecf20Sopenharmony_ci u16 phyrxstatus1; /* 0x3ea - 0x5 */ 2008c2ecf20Sopenharmony_ci u16 phycrsth; /* 0x3ec - 0x6 */ 2018c2ecf20Sopenharmony_ci u16 phytxerror; /* 0x3ee - 0x7 */ 2028c2ecf20Sopenharmony_ci u16 phychannel; /* 0x3f0 - 0x8 */ 2038c2ecf20Sopenharmony_ci u16 PAD[1]; /* 0x3f2 - 0x9 */ 2048c2ecf20Sopenharmony_ci u16 phytest; /* 0x3f4 - 0xa */ 2058c2ecf20Sopenharmony_ci u16 phy4waddr; /* 0x3f6 - 0xb */ 2068c2ecf20Sopenharmony_ci u16 phy4wdatahi; /* 0x3f8 - 0xc */ 2078c2ecf20Sopenharmony_ci u16 phy4wdatalo; /* 0x3fa - 0xd */ 2088c2ecf20Sopenharmony_ci u16 phyregaddr; /* 0x3fc - 0xe */ 2098c2ecf20Sopenharmony_ci u16 phyregdata; /* 0x3fe - 0xf */ 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci /* IHR *//* 0x400 - 0x7FE */ 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci /* RXE Block */ 2148c2ecf20Sopenharmony_ci u16 PAD[3]; /* 0x400 - 0x406 */ 2158c2ecf20Sopenharmony_ci u16 rcv_fifo_ctl; /* 0x406 */ 2168c2ecf20Sopenharmony_ci u16 PAD; /* 0x408 - 0x40a */ 2178c2ecf20Sopenharmony_ci u16 rcv_frm_cnt; /* 0x40a */ 2188c2ecf20Sopenharmony_ci u16 PAD[4]; /* 0x40a - 0x414 */ 2198c2ecf20Sopenharmony_ci u16 rssi; /* 0x414 */ 2208c2ecf20Sopenharmony_ci u16 PAD[5]; /* 0x414 - 0x420 */ 2218c2ecf20Sopenharmony_ci u16 rcm_ctl; /* 0x420 */ 2228c2ecf20Sopenharmony_ci u16 rcm_mat_data; /* 0x422 */ 2238c2ecf20Sopenharmony_ci u16 rcm_mat_mask; /* 0x424 */ 2248c2ecf20Sopenharmony_ci u16 rcm_mat_dly; /* 0x426 */ 2258c2ecf20Sopenharmony_ci u16 rcm_cond_mask_l; /* 0x428 */ 2268c2ecf20Sopenharmony_ci u16 rcm_cond_mask_h; /* 0x42A */ 2278c2ecf20Sopenharmony_ci u16 rcm_cond_dly; /* 0x42C */ 2288c2ecf20Sopenharmony_ci u16 PAD[1]; /* 0x42E */ 2298c2ecf20Sopenharmony_ci u16 ext_ihr_addr; /* 0x430 */ 2308c2ecf20Sopenharmony_ci u16 ext_ihr_data; /* 0x432 */ 2318c2ecf20Sopenharmony_ci u16 rxe_phyrs_2; /* 0x434 */ 2328c2ecf20Sopenharmony_ci u16 rxe_phyrs_3; /* 0x436 */ 2338c2ecf20Sopenharmony_ci u16 phy_mode; /* 0x438 */ 2348c2ecf20Sopenharmony_ci u16 rcmta_ctl; /* 0x43a */ 2358c2ecf20Sopenharmony_ci u16 rcmta_size; /* 0x43c */ 2368c2ecf20Sopenharmony_ci u16 rcmta_addr0; /* 0x43e */ 2378c2ecf20Sopenharmony_ci u16 rcmta_addr1; /* 0x440 */ 2388c2ecf20Sopenharmony_ci u16 rcmta_addr2; /* 0x442 */ 2398c2ecf20Sopenharmony_ci u16 PAD[30]; /* 0x444 - 0x480 */ 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_ci /* PSM Block *//* 0x480 - 0x500 */ 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci u16 PAD; /* 0x480 */ 2448c2ecf20Sopenharmony_ci u16 psm_maccontrol_h; /* 0x482 */ 2458c2ecf20Sopenharmony_ci u16 psm_macintstatus_l; /* 0x484 */ 2468c2ecf20Sopenharmony_ci u16 psm_macintstatus_h; /* 0x486 */ 2478c2ecf20Sopenharmony_ci u16 psm_macintmask_l; /* 0x488 */ 2488c2ecf20Sopenharmony_ci u16 psm_macintmask_h; /* 0x48A */ 2498c2ecf20Sopenharmony_ci u16 PAD; /* 0x48C */ 2508c2ecf20Sopenharmony_ci u16 psm_maccommand; /* 0x48E */ 2518c2ecf20Sopenharmony_ci u16 psm_brc; /* 0x490 */ 2528c2ecf20Sopenharmony_ci u16 psm_phy_hdr_param; /* 0x492 */ 2538c2ecf20Sopenharmony_ci u16 psm_postcard; /* 0x494 */ 2548c2ecf20Sopenharmony_ci u16 psm_pcard_loc_l; /* 0x496 */ 2558c2ecf20Sopenharmony_ci u16 psm_pcard_loc_h; /* 0x498 */ 2568c2ecf20Sopenharmony_ci u16 psm_gpio_in; /* 0x49A */ 2578c2ecf20Sopenharmony_ci u16 psm_gpio_out; /* 0x49C */ 2588c2ecf20Sopenharmony_ci u16 psm_gpio_oe; /* 0x49E */ 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci u16 psm_bred_0; /* 0x4A0 */ 2618c2ecf20Sopenharmony_ci u16 psm_bred_1; /* 0x4A2 */ 2628c2ecf20Sopenharmony_ci u16 psm_bred_2; /* 0x4A4 */ 2638c2ecf20Sopenharmony_ci u16 psm_bred_3; /* 0x4A6 */ 2648c2ecf20Sopenharmony_ci u16 psm_brcl_0; /* 0x4A8 */ 2658c2ecf20Sopenharmony_ci u16 psm_brcl_1; /* 0x4AA */ 2668c2ecf20Sopenharmony_ci u16 psm_brcl_2; /* 0x4AC */ 2678c2ecf20Sopenharmony_ci u16 psm_brcl_3; /* 0x4AE */ 2688c2ecf20Sopenharmony_ci u16 psm_brpo_0; /* 0x4B0 */ 2698c2ecf20Sopenharmony_ci u16 psm_brpo_1; /* 0x4B2 */ 2708c2ecf20Sopenharmony_ci u16 psm_brpo_2; /* 0x4B4 */ 2718c2ecf20Sopenharmony_ci u16 psm_brpo_3; /* 0x4B6 */ 2728c2ecf20Sopenharmony_ci u16 psm_brwk_0; /* 0x4B8 */ 2738c2ecf20Sopenharmony_ci u16 psm_brwk_1; /* 0x4BA */ 2748c2ecf20Sopenharmony_ci u16 psm_brwk_2; /* 0x4BC */ 2758c2ecf20Sopenharmony_ci u16 psm_brwk_3; /* 0x4BE */ 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci u16 psm_base_0; /* 0x4C0 */ 2788c2ecf20Sopenharmony_ci u16 psm_base_1; /* 0x4C2 */ 2798c2ecf20Sopenharmony_ci u16 psm_base_2; /* 0x4C4 */ 2808c2ecf20Sopenharmony_ci u16 psm_base_3; /* 0x4C6 */ 2818c2ecf20Sopenharmony_ci u16 psm_base_4; /* 0x4C8 */ 2828c2ecf20Sopenharmony_ci u16 psm_base_5; /* 0x4CA */ 2838c2ecf20Sopenharmony_ci u16 psm_base_6; /* 0x4CC */ 2848c2ecf20Sopenharmony_ci u16 psm_pc_reg_0; /* 0x4CE */ 2858c2ecf20Sopenharmony_ci u16 psm_pc_reg_1; /* 0x4D0 */ 2868c2ecf20Sopenharmony_ci u16 psm_pc_reg_2; /* 0x4D2 */ 2878c2ecf20Sopenharmony_ci u16 psm_pc_reg_3; /* 0x4D4 */ 2888c2ecf20Sopenharmony_ci u16 PAD[0xD]; /* 0x4D6 - 0x4DE */ 2898c2ecf20Sopenharmony_ci u16 psm_corectlsts; /* 0x4f0 *//* Corerev >= 13 */ 2908c2ecf20Sopenharmony_ci u16 PAD[0x7]; /* 0x4f2 - 0x4fE */ 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ci /* TXE0 Block *//* 0x500 - 0x580 */ 2938c2ecf20Sopenharmony_ci u16 txe_ctl; /* 0x500 */ 2948c2ecf20Sopenharmony_ci u16 txe_aux; /* 0x502 */ 2958c2ecf20Sopenharmony_ci u16 txe_ts_loc; /* 0x504 */ 2968c2ecf20Sopenharmony_ci u16 txe_time_out; /* 0x506 */ 2978c2ecf20Sopenharmony_ci u16 txe_wm_0; /* 0x508 */ 2988c2ecf20Sopenharmony_ci u16 txe_wm_1; /* 0x50A */ 2998c2ecf20Sopenharmony_ci u16 txe_phyctl; /* 0x50C */ 3008c2ecf20Sopenharmony_ci u16 txe_status; /* 0x50E */ 3018c2ecf20Sopenharmony_ci u16 txe_mmplcp0; /* 0x510 */ 3028c2ecf20Sopenharmony_ci u16 txe_mmplcp1; /* 0x512 */ 3038c2ecf20Sopenharmony_ci u16 txe_phyctl1; /* 0x514 */ 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_ci u16 PAD[0x05]; /* 0x510 - 0x51E */ 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci /* Transmit control */ 3088c2ecf20Sopenharmony_ci u16 xmtfifodef; /* 0x520 */ 3098c2ecf20Sopenharmony_ci u16 xmtfifo_frame_cnt; /* 0x522 *//* Corerev >= 16 */ 3108c2ecf20Sopenharmony_ci u16 xmtfifo_byte_cnt; /* 0x524 *//* Corerev >= 16 */ 3118c2ecf20Sopenharmony_ci u16 xmtfifo_head; /* 0x526 *//* Corerev >= 16 */ 3128c2ecf20Sopenharmony_ci u16 xmtfifo_rd_ptr; /* 0x528 *//* Corerev >= 16 */ 3138c2ecf20Sopenharmony_ci u16 xmtfifo_wr_ptr; /* 0x52A *//* Corerev >= 16 */ 3148c2ecf20Sopenharmony_ci u16 xmtfifodef1; /* 0x52C *//* Corerev >= 16 */ 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci u16 PAD[0x09]; /* 0x52E - 0x53E */ 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci u16 xmtfifocmd; /* 0x540 */ 3198c2ecf20Sopenharmony_ci u16 xmtfifoflush; /* 0x542 */ 3208c2ecf20Sopenharmony_ci u16 xmtfifothresh; /* 0x544 */ 3218c2ecf20Sopenharmony_ci u16 xmtfifordy; /* 0x546 */ 3228c2ecf20Sopenharmony_ci u16 xmtfifoprirdy; /* 0x548 */ 3238c2ecf20Sopenharmony_ci u16 xmtfiforqpri; /* 0x54A */ 3248c2ecf20Sopenharmony_ci u16 xmttplatetxptr; /* 0x54C */ 3258c2ecf20Sopenharmony_ci u16 PAD; /* 0x54E */ 3268c2ecf20Sopenharmony_ci u16 xmttplateptr; /* 0x550 */ 3278c2ecf20Sopenharmony_ci u16 smpl_clct_strptr; /* 0x552 *//* Corerev >= 22 */ 3288c2ecf20Sopenharmony_ci u16 smpl_clct_stpptr; /* 0x554 *//* Corerev >= 22 */ 3298c2ecf20Sopenharmony_ci u16 smpl_clct_curptr; /* 0x556 *//* Corerev >= 22 */ 3308c2ecf20Sopenharmony_ci u16 PAD[0x04]; /* 0x558 - 0x55E */ 3318c2ecf20Sopenharmony_ci u16 xmttplatedatalo; /* 0x560 */ 3328c2ecf20Sopenharmony_ci u16 xmttplatedatahi; /* 0x562 */ 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ci u16 PAD[2]; /* 0x564 - 0x566 */ 3358c2ecf20Sopenharmony_ci 3368c2ecf20Sopenharmony_ci u16 xmtsel; /* 0x568 */ 3378c2ecf20Sopenharmony_ci u16 xmttxcnt; /* 0x56A */ 3388c2ecf20Sopenharmony_ci u16 xmttxshmaddr; /* 0x56C */ 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_ci u16 PAD[0x09]; /* 0x56E - 0x57E */ 3418c2ecf20Sopenharmony_ci 3428c2ecf20Sopenharmony_ci /* TXE1 Block */ 3438c2ecf20Sopenharmony_ci u16 PAD[0x40]; /* 0x580 - 0x5FE */ 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ci /* TSF Block */ 3468c2ecf20Sopenharmony_ci u16 PAD[0X02]; /* 0x600 - 0x602 */ 3478c2ecf20Sopenharmony_ci u16 tsf_cfpstrt_l; /* 0x604 */ 3488c2ecf20Sopenharmony_ci u16 tsf_cfpstrt_h; /* 0x606 */ 3498c2ecf20Sopenharmony_ci u16 PAD[0X05]; /* 0x608 - 0x610 */ 3508c2ecf20Sopenharmony_ci u16 tsf_cfppretbtt; /* 0x612 */ 3518c2ecf20Sopenharmony_ci u16 PAD[0XD]; /* 0x614 - 0x62C */ 3528c2ecf20Sopenharmony_ci u16 tsf_clk_frac_l; /* 0x62E */ 3538c2ecf20Sopenharmony_ci u16 tsf_clk_frac_h; /* 0x630 */ 3548c2ecf20Sopenharmony_ci u16 PAD[0X14]; /* 0x632 - 0x658 */ 3558c2ecf20Sopenharmony_ci u16 tsf_random; /* 0x65A */ 3568c2ecf20Sopenharmony_ci u16 PAD[0x05]; /* 0x65C - 0x664 */ 3578c2ecf20Sopenharmony_ci /* GPTimer 2 registers */ 3588c2ecf20Sopenharmony_ci u16 tsf_gpt2_stat; /* 0x666 */ 3598c2ecf20Sopenharmony_ci u16 tsf_gpt2_ctr_l; /* 0x668 */ 3608c2ecf20Sopenharmony_ci u16 tsf_gpt2_ctr_h; /* 0x66A */ 3618c2ecf20Sopenharmony_ci u16 tsf_gpt2_val_l; /* 0x66C */ 3628c2ecf20Sopenharmony_ci u16 tsf_gpt2_val_h; /* 0x66E */ 3638c2ecf20Sopenharmony_ci u16 tsf_gptall_stat; /* 0x670 */ 3648c2ecf20Sopenharmony_ci u16 PAD[0x07]; /* 0x672 - 0x67E */ 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ci /* IFS Block */ 3678c2ecf20Sopenharmony_ci u16 ifs_sifs_rx_tx_tx; /* 0x680 */ 3688c2ecf20Sopenharmony_ci u16 ifs_sifs_nav_tx; /* 0x682 */ 3698c2ecf20Sopenharmony_ci u16 ifs_slot; /* 0x684 */ 3708c2ecf20Sopenharmony_ci u16 PAD; /* 0x686 */ 3718c2ecf20Sopenharmony_ci u16 ifs_ctl; /* 0x688 */ 3728c2ecf20Sopenharmony_ci u16 PAD[0x3]; /* 0x68a - 0x68F */ 3738c2ecf20Sopenharmony_ci u16 ifsstat; /* 0x690 */ 3748c2ecf20Sopenharmony_ci u16 ifsmedbusyctl; /* 0x692 */ 3758c2ecf20Sopenharmony_ci u16 iftxdur; /* 0x694 */ 3768c2ecf20Sopenharmony_ci u16 PAD[0x3]; /* 0x696 - 0x69b */ 3778c2ecf20Sopenharmony_ci /* EDCF support in dot11macs */ 3788c2ecf20Sopenharmony_ci u16 ifs_aifsn; /* 0x69c */ 3798c2ecf20Sopenharmony_ci u16 ifs_ctl1; /* 0x69e */ 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci /* slow clock registers */ 3828c2ecf20Sopenharmony_ci u16 scc_ctl; /* 0x6a0 */ 3838c2ecf20Sopenharmony_ci u16 scc_timer_l; /* 0x6a2 */ 3848c2ecf20Sopenharmony_ci u16 scc_timer_h; /* 0x6a4 */ 3858c2ecf20Sopenharmony_ci u16 scc_frac; /* 0x6a6 */ 3868c2ecf20Sopenharmony_ci u16 scc_fastpwrup_dly; /* 0x6a8 */ 3878c2ecf20Sopenharmony_ci u16 scc_per; /* 0x6aa */ 3888c2ecf20Sopenharmony_ci u16 scc_per_frac; /* 0x6ac */ 3898c2ecf20Sopenharmony_ci u16 scc_cal_timer_l; /* 0x6ae */ 3908c2ecf20Sopenharmony_ci u16 scc_cal_timer_h; /* 0x6b0 */ 3918c2ecf20Sopenharmony_ci u16 PAD; /* 0x6b2 */ 3928c2ecf20Sopenharmony_ci 3938c2ecf20Sopenharmony_ci u16 PAD[0x26]; 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_ci /* NAV Block */ 3968c2ecf20Sopenharmony_ci u16 nav_ctl; /* 0x700 */ 3978c2ecf20Sopenharmony_ci u16 navstat; /* 0x702 */ 3988c2ecf20Sopenharmony_ci u16 PAD[0x3e]; /* 0x702 - 0x77E */ 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci /* WEP/PMQ Block *//* 0x780 - 0x7FE */ 4018c2ecf20Sopenharmony_ci u16 PAD[0x20]; /* 0x780 - 0x7BE */ 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ci u16 wepctl; /* 0x7C0 */ 4048c2ecf20Sopenharmony_ci u16 wepivloc; /* 0x7C2 */ 4058c2ecf20Sopenharmony_ci u16 wepivkey; /* 0x7C4 */ 4068c2ecf20Sopenharmony_ci u16 wepwkey; /* 0x7C6 */ 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_ci u16 PAD[4]; /* 0x7C8 - 0x7CE */ 4098c2ecf20Sopenharmony_ci u16 pcmctl; /* 0X7D0 */ 4108c2ecf20Sopenharmony_ci u16 pcmstat; /* 0X7D2 */ 4118c2ecf20Sopenharmony_ci u16 PAD[6]; /* 0x7D4 - 0x7DE */ 4128c2ecf20Sopenharmony_ci 4138c2ecf20Sopenharmony_ci u16 pmqctl; /* 0x7E0 */ 4148c2ecf20Sopenharmony_ci u16 pmqstatus; /* 0x7E2 */ 4158c2ecf20Sopenharmony_ci u16 pmqpat0; /* 0x7E4 */ 4168c2ecf20Sopenharmony_ci u16 pmqpat1; /* 0x7E6 */ 4178c2ecf20Sopenharmony_ci u16 pmqpat2; /* 0x7E8 */ 4188c2ecf20Sopenharmony_ci 4198c2ecf20Sopenharmony_ci u16 pmqdat; /* 0x7EA */ 4208c2ecf20Sopenharmony_ci u16 pmqdator; /* 0x7EC */ 4218c2ecf20Sopenharmony_ci u16 pmqhst; /* 0x7EE */ 4228c2ecf20Sopenharmony_ci u16 pmqpath0; /* 0x7F0 */ 4238c2ecf20Sopenharmony_ci u16 pmqpath1; /* 0x7F2 */ 4248c2ecf20Sopenharmony_ci u16 pmqpath2; /* 0x7F4 */ 4258c2ecf20Sopenharmony_ci u16 pmqdath; /* 0x7F6 */ 4268c2ecf20Sopenharmony_ci 4278c2ecf20Sopenharmony_ci u16 PAD[0x04]; /* 0x7F8 - 0x7FE */ 4288c2ecf20Sopenharmony_ci 4298c2ecf20Sopenharmony_ci /* SHM *//* 0x800 - 0xEFE */ 4308c2ecf20Sopenharmony_ci u16 PAD[0x380]; /* 0x800 - 0xEFE */ 4318c2ecf20Sopenharmony_ci}; 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_ci/* d11 register field offset */ 4348c2ecf20Sopenharmony_ci#define D11REGOFFS(field) offsetof(struct d11regs, field) 4358c2ecf20Sopenharmony_ci 4368c2ecf20Sopenharmony_ci#define PIHR_BASE 0x0400 /* byte address of packed IHR region */ 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci/* biststatus */ 4398c2ecf20Sopenharmony_ci#define BT_DONE (1U << 31) /* bist done */ 4408c2ecf20Sopenharmony_ci#define BT_B2S (1 << 30) /* bist2 ram summary bit */ 4418c2ecf20Sopenharmony_ci 4428c2ecf20Sopenharmony_ci/* intstatus and intmask */ 4438c2ecf20Sopenharmony_ci#define I_PC (1 << 10) /* pci descriptor error */ 4448c2ecf20Sopenharmony_ci#define I_PD (1 << 11) /* pci data error */ 4458c2ecf20Sopenharmony_ci#define I_DE (1 << 12) /* descriptor protocol error */ 4468c2ecf20Sopenharmony_ci#define I_RU (1 << 13) /* receive descriptor underflow */ 4478c2ecf20Sopenharmony_ci#define I_RO (1 << 14) /* receive fifo overflow */ 4488c2ecf20Sopenharmony_ci#define I_XU (1 << 15) /* transmit fifo underflow */ 4498c2ecf20Sopenharmony_ci#define I_RI (1 << 16) /* receive interrupt */ 4508c2ecf20Sopenharmony_ci#define I_XI (1 << 24) /* transmit interrupt */ 4518c2ecf20Sopenharmony_ci 4528c2ecf20Sopenharmony_ci/* interrupt receive lazy */ 4538c2ecf20Sopenharmony_ci#define IRL_TO_MASK 0x00ffffff /* timeout */ 4548c2ecf20Sopenharmony_ci#define IRL_FC_MASK 0xff000000 /* frame count */ 4558c2ecf20Sopenharmony_ci#define IRL_FC_SHIFT 24 /* frame count */ 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci/*== maccontrol register ==*/ 4588c2ecf20Sopenharmony_ci#define MCTL_GMODE (1U << 31) 4598c2ecf20Sopenharmony_ci#define MCTL_DISCARD_PMQ (1 << 30) 4608c2ecf20Sopenharmony_ci#define MCTL_TBTTHOLD (1 << 28) 4618c2ecf20Sopenharmony_ci#define MCTL_WAKE (1 << 26) 4628c2ecf20Sopenharmony_ci#define MCTL_HPS (1 << 25) 4638c2ecf20Sopenharmony_ci#define MCTL_PROMISC (1 << 24) 4648c2ecf20Sopenharmony_ci#define MCTL_KEEPBADFCS (1 << 23) 4658c2ecf20Sopenharmony_ci#define MCTL_KEEPCONTROL (1 << 22) 4668c2ecf20Sopenharmony_ci#define MCTL_PHYLOCK (1 << 21) 4678c2ecf20Sopenharmony_ci#define MCTL_BCNS_PROMISC (1 << 20) 4688c2ecf20Sopenharmony_ci#define MCTL_LOCK_RADIO (1 << 19) 4698c2ecf20Sopenharmony_ci#define MCTL_AP (1 << 18) 4708c2ecf20Sopenharmony_ci#define MCTL_INFRA (1 << 17) 4718c2ecf20Sopenharmony_ci#define MCTL_BIGEND (1 << 16) 4728c2ecf20Sopenharmony_ci#define MCTL_GPOUT_SEL_MASK (3 << 14) 4738c2ecf20Sopenharmony_ci#define MCTL_GPOUT_SEL_SHIFT 14 4748c2ecf20Sopenharmony_ci#define MCTL_EN_PSMDBG (1 << 13) 4758c2ecf20Sopenharmony_ci#define MCTL_IHR_EN (1 << 10) 4768c2ecf20Sopenharmony_ci#define MCTL_SHM_UPPER (1 << 9) 4778c2ecf20Sopenharmony_ci#define MCTL_SHM_EN (1 << 8) 4788c2ecf20Sopenharmony_ci#define MCTL_PSM_JMP_0 (1 << 2) 4798c2ecf20Sopenharmony_ci#define MCTL_PSM_RUN (1 << 1) 4808c2ecf20Sopenharmony_ci#define MCTL_EN_MAC (1 << 0) 4818c2ecf20Sopenharmony_ci 4828c2ecf20Sopenharmony_ci/*== maccommand register ==*/ 4838c2ecf20Sopenharmony_ci#define MCMD_BCN0VLD (1 << 0) 4848c2ecf20Sopenharmony_ci#define MCMD_BCN1VLD (1 << 1) 4858c2ecf20Sopenharmony_ci#define MCMD_DIRFRMQVAL (1 << 2) 4868c2ecf20Sopenharmony_ci#define MCMD_CCA (1 << 3) 4878c2ecf20Sopenharmony_ci#define MCMD_BG_NOISE (1 << 4) 4888c2ecf20Sopenharmony_ci#define MCMD_SKIP_SHMINIT (1 << 5) /* only used for simulation */ 4898c2ecf20Sopenharmony_ci#define MCMD_SAMPLECOLL MCMD_SKIP_SHMINIT /* reuse for sample collect */ 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_ci/*== macintstatus/macintmask ==*/ 4928c2ecf20Sopenharmony_ci/* gracefully suspended */ 4938c2ecf20Sopenharmony_ci#define MI_MACSSPNDD (1 << 0) 4948c2ecf20Sopenharmony_ci/* beacon template available */ 4958c2ecf20Sopenharmony_ci#define MI_BCNTPL (1 << 1) 4968c2ecf20Sopenharmony_ci/* TBTT indication */ 4978c2ecf20Sopenharmony_ci#define MI_TBTT (1 << 2) 4988c2ecf20Sopenharmony_ci/* beacon successfully tx'd */ 4998c2ecf20Sopenharmony_ci#define MI_BCNSUCCESS (1 << 3) 5008c2ecf20Sopenharmony_ci/* beacon canceled (IBSS) */ 5018c2ecf20Sopenharmony_ci#define MI_BCNCANCLD (1 << 4) 5028c2ecf20Sopenharmony_ci/* end of ATIM-window (IBSS) */ 5038c2ecf20Sopenharmony_ci#define MI_ATIMWINEND (1 << 5) 5048c2ecf20Sopenharmony_ci/* PMQ entries available */ 5058c2ecf20Sopenharmony_ci#define MI_PMQ (1 << 6) 5068c2ecf20Sopenharmony_ci/* non-specific gen-stat bits that are set by PSM */ 5078c2ecf20Sopenharmony_ci#define MI_NSPECGEN_0 (1 << 7) 5088c2ecf20Sopenharmony_ci/* non-specific gen-stat bits that are set by PSM */ 5098c2ecf20Sopenharmony_ci#define MI_NSPECGEN_1 (1 << 8) 5108c2ecf20Sopenharmony_ci/* MAC level Tx error */ 5118c2ecf20Sopenharmony_ci#define MI_MACTXERR (1 << 9) 5128c2ecf20Sopenharmony_ci/* non-specific gen-stat bits that are set by PSM */ 5138c2ecf20Sopenharmony_ci#define MI_NSPECGEN_3 (1 << 10) 5148c2ecf20Sopenharmony_ci/* PHY Tx error */ 5158c2ecf20Sopenharmony_ci#define MI_PHYTXERR (1 << 11) 5168c2ecf20Sopenharmony_ci/* Power Management Event */ 5178c2ecf20Sopenharmony_ci#define MI_PME (1 << 12) 5188c2ecf20Sopenharmony_ci/* General-purpose timer0 */ 5198c2ecf20Sopenharmony_ci#define MI_GP0 (1 << 13) 5208c2ecf20Sopenharmony_ci/* General-purpose timer1 */ 5218c2ecf20Sopenharmony_ci#define MI_GP1 (1 << 14) 5228c2ecf20Sopenharmony_ci/* (ORed) DMA-interrupts */ 5238c2ecf20Sopenharmony_ci#define MI_DMAINT (1 << 15) 5248c2ecf20Sopenharmony_ci/* MAC has completed a TX FIFO Suspend/Flush */ 5258c2ecf20Sopenharmony_ci#define MI_TXSTOP (1 << 16) 5268c2ecf20Sopenharmony_ci/* MAC has completed a CCA measurement */ 5278c2ecf20Sopenharmony_ci#define MI_CCA (1 << 17) 5288c2ecf20Sopenharmony_ci/* MAC has collected background noise samples */ 5298c2ecf20Sopenharmony_ci#define MI_BG_NOISE (1 << 18) 5308c2ecf20Sopenharmony_ci/* MBSS DTIM TBTT indication */ 5318c2ecf20Sopenharmony_ci#define MI_DTIM_TBTT (1 << 19) 5328c2ecf20Sopenharmony_ci/* Probe response queue needs attention */ 5338c2ecf20Sopenharmony_ci#define MI_PRQ (1 << 20) 5348c2ecf20Sopenharmony_ci/* Radio/PHY has been powered back up. */ 5358c2ecf20Sopenharmony_ci#define MI_PWRUP (1 << 21) 5368c2ecf20Sopenharmony_ci#define MI_RESERVED3 (1 << 22) 5378c2ecf20Sopenharmony_ci#define MI_RESERVED2 (1 << 23) 5388c2ecf20Sopenharmony_ci#define MI_RESERVED1 (1 << 25) 5398c2ecf20Sopenharmony_ci/* MAC detected change on RF Disable input*/ 5408c2ecf20Sopenharmony_ci#define MI_RFDISABLE (1 << 28) 5418c2ecf20Sopenharmony_ci/* MAC has completed a TX */ 5428c2ecf20Sopenharmony_ci#define MI_TFS (1 << 29) 5438c2ecf20Sopenharmony_ci/* A phy status change wrt G mode */ 5448c2ecf20Sopenharmony_ci#define MI_PHYCHANGED (1 << 30) 5458c2ecf20Sopenharmony_ci/* general purpose timeout */ 5468c2ecf20Sopenharmony_ci#define MI_TO (1U << 31) 5478c2ecf20Sopenharmony_ci 5488c2ecf20Sopenharmony_ci/* Mac capabilities registers */ 5498c2ecf20Sopenharmony_ci/*== machwcap ==*/ 5508c2ecf20Sopenharmony_ci#define MCAP_TKIPMIC 0x80000000 /* TKIP MIC hardware present */ 5518c2ecf20Sopenharmony_ci 5528c2ecf20Sopenharmony_ci/*== pmqhost data ==*/ 5538c2ecf20Sopenharmony_ci/* data entry of head pmq entry */ 5548c2ecf20Sopenharmony_ci#define PMQH_DATA_MASK 0xffff0000 5558c2ecf20Sopenharmony_ci/* PM entry for BSS config */ 5568c2ecf20Sopenharmony_ci#define PMQH_BSSCFG 0x00100000 5578c2ecf20Sopenharmony_ci/* PM Mode OFF: power save off */ 5588c2ecf20Sopenharmony_ci#define PMQH_PMOFF 0x00010000 5598c2ecf20Sopenharmony_ci/* PM Mode ON: power save on */ 5608c2ecf20Sopenharmony_ci#define PMQH_PMON 0x00020000 5618c2ecf20Sopenharmony_ci/* Dis-associated or De-authenticated */ 5628c2ecf20Sopenharmony_ci#define PMQH_DASAT 0x00040000 5638c2ecf20Sopenharmony_ci/* ATIM not acknowledged */ 5648c2ecf20Sopenharmony_ci#define PMQH_ATIMFAIL 0x00080000 5658c2ecf20Sopenharmony_ci/* delete head entry */ 5668c2ecf20Sopenharmony_ci#define PMQH_DEL_ENTRY 0x00000001 5678c2ecf20Sopenharmony_ci/* delete head entry to cur read pointer -1 */ 5688c2ecf20Sopenharmony_ci#define PMQH_DEL_MULT 0x00000002 5698c2ecf20Sopenharmony_ci/* pmq overflow indication */ 5708c2ecf20Sopenharmony_ci#define PMQH_OFLO 0x00000004 5718c2ecf20Sopenharmony_ci/* entries are present in pmq */ 5728c2ecf20Sopenharmony_ci#define PMQH_NOT_EMPTY 0x00000008 5738c2ecf20Sopenharmony_ci 5748c2ecf20Sopenharmony_ci/*== phydebug ==*/ 5758c2ecf20Sopenharmony_ci/* phy is asserting carrier sense */ 5768c2ecf20Sopenharmony_ci#define PDBG_CRS (1 << 0) 5778c2ecf20Sopenharmony_ci/* phy is taking xmit byte from mac this cycle */ 5788c2ecf20Sopenharmony_ci#define PDBG_TXA (1 << 1) 5798c2ecf20Sopenharmony_ci/* mac is instructing the phy to transmit a frame */ 5808c2ecf20Sopenharmony_ci#define PDBG_TXF (1 << 2) 5818c2ecf20Sopenharmony_ci/* phy is signalling a transmit Error to the mac */ 5828c2ecf20Sopenharmony_ci#define PDBG_TXE (1 << 3) 5838c2ecf20Sopenharmony_ci/* phy detected the end of a valid frame preamble */ 5848c2ecf20Sopenharmony_ci#define PDBG_RXF (1 << 4) 5858c2ecf20Sopenharmony_ci/* phy detected the end of a valid PLCP header */ 5868c2ecf20Sopenharmony_ci#define PDBG_RXS (1 << 5) 5878c2ecf20Sopenharmony_ci/* rx start not asserted */ 5888c2ecf20Sopenharmony_ci#define PDBG_RXFRG (1 << 6) 5898c2ecf20Sopenharmony_ci/* mac is taking receive byte from phy this cycle */ 5908c2ecf20Sopenharmony_ci#define PDBG_RXV (1 << 7) 5918c2ecf20Sopenharmony_ci/* RF portion of the radio is disabled */ 5928c2ecf20Sopenharmony_ci#define PDBG_RFD (1 << 16) 5938c2ecf20Sopenharmony_ci 5948c2ecf20Sopenharmony_ci/*== objaddr register ==*/ 5958c2ecf20Sopenharmony_ci#define OBJADDR_SEL_MASK 0x000F0000 5968c2ecf20Sopenharmony_ci#define OBJADDR_UCM_SEL 0x00000000 5978c2ecf20Sopenharmony_ci#define OBJADDR_SHM_SEL 0x00010000 5988c2ecf20Sopenharmony_ci#define OBJADDR_SCR_SEL 0x00020000 5998c2ecf20Sopenharmony_ci#define OBJADDR_IHR_SEL 0x00030000 6008c2ecf20Sopenharmony_ci#define OBJADDR_RCMTA_SEL 0x00040000 6018c2ecf20Sopenharmony_ci#define OBJADDR_SRCHM_SEL 0x00060000 6028c2ecf20Sopenharmony_ci#define OBJADDR_WINC 0x01000000 6038c2ecf20Sopenharmony_ci#define OBJADDR_RINC 0x02000000 6048c2ecf20Sopenharmony_ci#define OBJADDR_AUTO_INC 0x03000000 6058c2ecf20Sopenharmony_ci 6068c2ecf20Sopenharmony_ci#define WEP_PCMADDR 0x07d4 6078c2ecf20Sopenharmony_ci#define WEP_PCMDATA 0x07d6 6088c2ecf20Sopenharmony_ci 6098c2ecf20Sopenharmony_ci/*== frmtxstatus ==*/ 6108c2ecf20Sopenharmony_ci#define TXS_V (1 << 0) /* valid bit */ 6118c2ecf20Sopenharmony_ci#define TXS_STATUS_MASK 0xffff 6128c2ecf20Sopenharmony_ci#define TXS_FID_MASK 0xffff0000 6138c2ecf20Sopenharmony_ci#define TXS_FID_SHIFT 16 6148c2ecf20Sopenharmony_ci 6158c2ecf20Sopenharmony_ci/*== frmtxstatus2 ==*/ 6168c2ecf20Sopenharmony_ci#define TXS_SEQ_MASK 0xffff 6178c2ecf20Sopenharmony_ci#define TXS_PTX_MASK 0xff0000 6188c2ecf20Sopenharmony_ci#define TXS_PTX_SHIFT 16 6198c2ecf20Sopenharmony_ci#define TXS_MU_MASK 0x01000000 6208c2ecf20Sopenharmony_ci#define TXS_MU_SHIFT 24 6218c2ecf20Sopenharmony_ci 6228c2ecf20Sopenharmony_ci/*== clk_ctl_st ==*/ 6238c2ecf20Sopenharmony_ci#define CCS_ERSRC_REQ_D11PLL 0x00000100 /* d11 core pll request */ 6248c2ecf20Sopenharmony_ci#define CCS_ERSRC_REQ_PHYPLL 0x00000200 /* PHY pll request */ 6258c2ecf20Sopenharmony_ci#define CCS_ERSRC_AVAIL_D11PLL 0x01000000 /* d11 core pll available */ 6268c2ecf20Sopenharmony_ci#define CCS_ERSRC_AVAIL_PHYPLL 0x02000000 /* PHY pll available */ 6278c2ecf20Sopenharmony_ci 6288c2ecf20Sopenharmony_ci/* HT Cloclk Ctrl and Clock Avail for 4313 */ 6298c2ecf20Sopenharmony_ci#define CCS_ERSRC_REQ_HT 0x00000010 /* HT avail request */ 6308c2ecf20Sopenharmony_ci#define CCS_ERSRC_AVAIL_HT 0x00020000 /* HT clock available */ 6318c2ecf20Sopenharmony_ci 6328c2ecf20Sopenharmony_ci/* tsf_cfprep register */ 6338c2ecf20Sopenharmony_ci#define CFPREP_CBI_MASK 0xffffffc0 6348c2ecf20Sopenharmony_ci#define CFPREP_CBI_SHIFT 6 6358c2ecf20Sopenharmony_ci#define CFPREP_CFPP 0x00000001 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci/* tx fifo sizes values are in terms of 256 byte blocks */ 6388c2ecf20Sopenharmony_ci#define TXFIFOCMD_RESET_MASK (1 << 15) /* reset */ 6398c2ecf20Sopenharmony_ci#define TXFIFOCMD_FIFOSEL_SHIFT 8 /* fifo */ 6408c2ecf20Sopenharmony_ci#define TXFIFO_FIFOTOP_SHIFT 8 /* fifo start */ 6418c2ecf20Sopenharmony_ci 6428c2ecf20Sopenharmony_ci#define TXFIFO_START_BLK16 65 /* Base address + 32 * 512 B/P */ 6438c2ecf20Sopenharmony_ci#define TXFIFO_START_BLK 6 /* Base address + 6 * 256 B */ 6448c2ecf20Sopenharmony_ci#define TXFIFO_SIZE_UNIT 256 /* one unit corresponds to 256 bytes */ 6458c2ecf20Sopenharmony_ci#define MBSS16_TEMPLMEM_MINBLKS 65 /* one unit corresponds to 256 bytes */ 6468c2ecf20Sopenharmony_ci 6478c2ecf20Sopenharmony_ci/*== phy versions (PhyVersion:Revision field) ==*/ 6488c2ecf20Sopenharmony_ci/* analog block version */ 6498c2ecf20Sopenharmony_ci#define PV_AV_MASK 0xf000 6508c2ecf20Sopenharmony_ci/* analog block version bitfield offset */ 6518c2ecf20Sopenharmony_ci#define PV_AV_SHIFT 12 6528c2ecf20Sopenharmony_ci/* phy type */ 6538c2ecf20Sopenharmony_ci#define PV_PT_MASK 0x0f00 6548c2ecf20Sopenharmony_ci/* phy type bitfield offset */ 6558c2ecf20Sopenharmony_ci#define PV_PT_SHIFT 8 6568c2ecf20Sopenharmony_ci/* phy version */ 6578c2ecf20Sopenharmony_ci#define PV_PV_MASK 0x000f 6588c2ecf20Sopenharmony_ci#define PHY_TYPE(v) ((v & PV_PT_MASK) >> PV_PT_SHIFT) 6598c2ecf20Sopenharmony_ci 6608c2ecf20Sopenharmony_ci/*== phy types (PhyVersion:PhyType field) ==*/ 6618c2ecf20Sopenharmony_ci#define PHY_TYPE_N 4 /* N-Phy value */ 6628c2ecf20Sopenharmony_ci#define PHY_TYPE_SSN 6 /* SSLPN-Phy value */ 6638c2ecf20Sopenharmony_ci#define PHY_TYPE_LCN 8 /* LCN-Phy value */ 6648c2ecf20Sopenharmony_ci#define PHY_TYPE_LCNXN 9 /* LCNXN-Phy value */ 6658c2ecf20Sopenharmony_ci#define PHY_TYPE_NULL 0xf /* Invalid Phy value */ 6668c2ecf20Sopenharmony_ci 6678c2ecf20Sopenharmony_ci/*== analog types (PhyVersion:AnalogType field) ==*/ 6688c2ecf20Sopenharmony_ci#define ANA_11N_013 5 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_ci/* 802.11a PLCP header def */ 6718c2ecf20Sopenharmony_cistruct ofdm_phy_hdr { 6728c2ecf20Sopenharmony_ci u8 rlpt[3]; /* rate, length, parity, tail */ 6738c2ecf20Sopenharmony_ci u16 service; 6748c2ecf20Sopenharmony_ci u8 pad; 6758c2ecf20Sopenharmony_ci} __packed; 6768c2ecf20Sopenharmony_ci 6778c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_GRATE(phdr) ((phdr)->rlpt[0] & 0x0f) 6788c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_GRES(phdr) (((phdr)->rlpt[0] >> 4) & 0x01) 6798c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_GLENGTH(phdr) (((u32 *)((phdr)->rlpt) >> 5) & 0x0fff) 6808c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_GPARITY(phdr) (((phdr)->rlpt[3] >> 1) & 0x01) 6818c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_GTAIL(phdr) (((phdr)->rlpt[3] >> 2) & 0x3f) 6828c2ecf20Sopenharmony_ci 6838c2ecf20Sopenharmony_ci/* rate encoded per 802.11a-1999 sec 17.3.4.1 */ 6848c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_SRATE(phdr, rate) \ 6858c2ecf20Sopenharmony_ci ((phdr)->rlpt[0] = ((phdr)->rlpt[0] & 0xf0) | ((rate) & 0xf)) 6868c2ecf20Sopenharmony_ci/* set reserved field to zero */ 6878c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_SRES(phdr) ((phdr)->rlpt[0] &= 0xef) 6888c2ecf20Sopenharmony_ci/* length is number of octets in PSDU */ 6898c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_SLENGTH(phdr, length) \ 6908c2ecf20Sopenharmony_ci (*(u32 *)((phdr)->rlpt) = *(u32 *)((phdr)->rlpt) | \ 6918c2ecf20Sopenharmony_ci (((length) & 0x0fff) << 5)) 6928c2ecf20Sopenharmony_ci/* set the tail to all zeros */ 6938c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_STAIL(phdr) ((phdr)->rlpt[3] &= 0x03) 6948c2ecf20Sopenharmony_ci 6958c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_LEN_L 3 /* low-rate part of PLCP header */ 6968c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_LEN_R 2 /* high-rate part of PLCP header */ 6978c2ecf20Sopenharmony_ci 6988c2ecf20Sopenharmony_ci#define D11A_PHY_TX_DELAY (2) /* 2.1 usec */ 6998c2ecf20Sopenharmony_ci 7008c2ecf20Sopenharmony_ci#define D11A_PHY_HDR_TIME (4) /* low-rate part of PLCP header */ 7018c2ecf20Sopenharmony_ci#define D11A_PHY_PRE_TIME (16) 7028c2ecf20Sopenharmony_ci#define D11A_PHY_PREHDR_TIME (D11A_PHY_PRE_TIME + D11A_PHY_HDR_TIME) 7038c2ecf20Sopenharmony_ci 7048c2ecf20Sopenharmony_ci/* 802.11b PLCP header def */ 7058c2ecf20Sopenharmony_cistruct cck_phy_hdr { 7068c2ecf20Sopenharmony_ci u8 signal; 7078c2ecf20Sopenharmony_ci u8 service; 7088c2ecf20Sopenharmony_ci u16 length; 7098c2ecf20Sopenharmony_ci u16 crc; 7108c2ecf20Sopenharmony_ci} __packed; 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci#define D11B_PHY_HDR_LEN 6 7138c2ecf20Sopenharmony_ci 7148c2ecf20Sopenharmony_ci#define D11B_PHY_TX_DELAY (3) /* 3.4 usec */ 7158c2ecf20Sopenharmony_ci 7168c2ecf20Sopenharmony_ci#define D11B_PHY_LHDR_TIME (D11B_PHY_HDR_LEN << 3) 7178c2ecf20Sopenharmony_ci#define D11B_PHY_LPRE_TIME (144) 7188c2ecf20Sopenharmony_ci#define D11B_PHY_LPREHDR_TIME (D11B_PHY_LPRE_TIME + D11B_PHY_LHDR_TIME) 7198c2ecf20Sopenharmony_ci 7208c2ecf20Sopenharmony_ci#define D11B_PHY_SHDR_TIME (D11B_PHY_LHDR_TIME >> 1) 7218c2ecf20Sopenharmony_ci#define D11B_PHY_SPRE_TIME (D11B_PHY_LPRE_TIME >> 1) 7228c2ecf20Sopenharmony_ci#define D11B_PHY_SPREHDR_TIME (D11B_PHY_SPRE_TIME + D11B_PHY_SHDR_TIME) 7238c2ecf20Sopenharmony_ci 7248c2ecf20Sopenharmony_ci#define D11B_PLCP_SIGNAL_LOCKED (1 << 2) 7258c2ecf20Sopenharmony_ci#define D11B_PLCP_SIGNAL_LE (1 << 7) 7268c2ecf20Sopenharmony_ci 7278c2ecf20Sopenharmony_ci#define MIMO_PLCP_MCS_MASK 0x7f /* mcs index */ 7288c2ecf20Sopenharmony_ci#define MIMO_PLCP_40MHZ 0x80 /* 40 Hz frame */ 7298c2ecf20Sopenharmony_ci#define MIMO_PLCP_AMPDU 0x08 /* ampdu */ 7308c2ecf20Sopenharmony_ci 7318c2ecf20Sopenharmony_ci#define BRCMS_GET_CCK_PLCP_LEN(plcp) (plcp[4] + (plcp[5] << 8)) 7328c2ecf20Sopenharmony_ci#define BRCMS_GET_MIMO_PLCP_LEN(plcp) (plcp[1] + (plcp[2] << 8)) 7338c2ecf20Sopenharmony_ci#define BRCMS_SET_MIMO_PLCP_LEN(plcp, len) \ 7348c2ecf20Sopenharmony_ci do { \ 7358c2ecf20Sopenharmony_ci plcp[1] = len & 0xff; \ 7368c2ecf20Sopenharmony_ci plcp[2] = ((len >> 8) & 0xff); \ 7378c2ecf20Sopenharmony_ci } while (0) 7388c2ecf20Sopenharmony_ci 7398c2ecf20Sopenharmony_ci#define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU) 7408c2ecf20Sopenharmony_ci#define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU) 7418c2ecf20Sopenharmony_ci#define BRCMS_IS_MIMO_PLCP_AMPDU(plcp) (plcp[3] & MIMO_PLCP_AMPDU) 7428c2ecf20Sopenharmony_ci 7438c2ecf20Sopenharmony_ci/* 7448c2ecf20Sopenharmony_ci * The dot11a PLCP header is 5 bytes. To simplify the software (so that we 7458c2ecf20Sopenharmony_ci * don't need e.g. different tx DMA headers for 11a and 11b), the PLCP header 7468c2ecf20Sopenharmony_ci * has padding added in the ucode. 7478c2ecf20Sopenharmony_ci */ 7488c2ecf20Sopenharmony_ci#define D11_PHY_HDR_LEN 6 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci/* TX DMA buffer header */ 7518c2ecf20Sopenharmony_cistruct d11txh { 7528c2ecf20Sopenharmony_ci __le16 MacTxControlLow; /* 0x0 */ 7538c2ecf20Sopenharmony_ci __le16 MacTxControlHigh; /* 0x1 */ 7548c2ecf20Sopenharmony_ci __le16 MacFrameControl; /* 0x2 */ 7558c2ecf20Sopenharmony_ci __le16 TxFesTimeNormal; /* 0x3 */ 7568c2ecf20Sopenharmony_ci __le16 PhyTxControlWord; /* 0x4 */ 7578c2ecf20Sopenharmony_ci __le16 PhyTxControlWord_1; /* 0x5 */ 7588c2ecf20Sopenharmony_ci __le16 PhyTxControlWord_1_Fbr; /* 0x6 */ 7598c2ecf20Sopenharmony_ci __le16 PhyTxControlWord_1_Rts; /* 0x7 */ 7608c2ecf20Sopenharmony_ci __le16 PhyTxControlWord_1_FbrRts; /* 0x8 */ 7618c2ecf20Sopenharmony_ci __le16 MainRates; /* 0x9 */ 7628c2ecf20Sopenharmony_ci __le16 XtraFrameTypes; /* 0xa */ 7638c2ecf20Sopenharmony_ci u8 IV[16]; /* 0x0b - 0x12 */ 7648c2ecf20Sopenharmony_ci u8 TxFrameRA[6]; /* 0x13 - 0x15 */ 7658c2ecf20Sopenharmony_ci __le16 TxFesTimeFallback; /* 0x16 */ 7668c2ecf20Sopenharmony_ci u8 RTSPLCPFallback[6]; /* 0x17 - 0x19 */ 7678c2ecf20Sopenharmony_ci __le16 RTSDurFallback; /* 0x1a */ 7688c2ecf20Sopenharmony_ci u8 FragPLCPFallback[6]; /* 0x1b - 1d */ 7698c2ecf20Sopenharmony_ci __le16 FragDurFallback; /* 0x1e */ 7708c2ecf20Sopenharmony_ci __le16 MModeLen; /* 0x1f */ 7718c2ecf20Sopenharmony_ci __le16 MModeFbrLen; /* 0x20 */ 7728c2ecf20Sopenharmony_ci __le16 TstampLow; /* 0x21 */ 7738c2ecf20Sopenharmony_ci __le16 TstampHigh; /* 0x22 */ 7748c2ecf20Sopenharmony_ci __le16 ABI_MimoAntSel; /* 0x23 */ 7758c2ecf20Sopenharmony_ci __le16 PreloadSize; /* 0x24 */ 7768c2ecf20Sopenharmony_ci __le16 AmpduSeqCtl; /* 0x25 */ 7778c2ecf20Sopenharmony_ci __le16 TxFrameID; /* 0x26 */ 7788c2ecf20Sopenharmony_ci __le16 TxStatus; /* 0x27 */ 7798c2ecf20Sopenharmony_ci __le16 MaxNMpdus; /* 0x28 */ 7808c2ecf20Sopenharmony_ci __le16 MaxABytes_MRT; /* 0x29 */ 7818c2ecf20Sopenharmony_ci __le16 MaxABytes_FBR; /* 0x2a */ 7828c2ecf20Sopenharmony_ci __le16 MinMBytes; /* 0x2b */ 7838c2ecf20Sopenharmony_ci u8 RTSPhyHeader[D11_PHY_HDR_LEN]; /* 0x2c - 0x2e */ 7848c2ecf20Sopenharmony_ci struct ieee80211_rts rts_frame; /* 0x2f - 0x36 */ 7858c2ecf20Sopenharmony_ci u16 PAD; /* 0x37 */ 7868c2ecf20Sopenharmony_ci} __packed; 7878c2ecf20Sopenharmony_ci 7888c2ecf20Sopenharmony_ci#define D11_TXH_LEN 112 /* bytes */ 7898c2ecf20Sopenharmony_ci 7908c2ecf20Sopenharmony_ci/* Frame Types */ 7918c2ecf20Sopenharmony_ci#define FT_CCK 0 7928c2ecf20Sopenharmony_ci#define FT_OFDM 1 7938c2ecf20Sopenharmony_ci#define FT_HT 2 7948c2ecf20Sopenharmony_ci#define FT_N 3 7958c2ecf20Sopenharmony_ci 7968c2ecf20Sopenharmony_ci/* 7978c2ecf20Sopenharmony_ci * Position of MPDU inside A-MPDU; indicated with bits 10:9 7988c2ecf20Sopenharmony_ci * of MacTxControlLow 7998c2ecf20Sopenharmony_ci */ 8008c2ecf20Sopenharmony_ci#define TXC_AMPDU_SHIFT 9 /* shift for ampdu settings */ 8018c2ecf20Sopenharmony_ci#define TXC_AMPDU_NONE 0 /* Regular MPDU, not an A-MPDU */ 8028c2ecf20Sopenharmony_ci#define TXC_AMPDU_FIRST 1 /* first MPDU of an A-MPDU */ 8038c2ecf20Sopenharmony_ci#define TXC_AMPDU_MIDDLE 2 /* intermediate MPDU of an A-MPDU */ 8048c2ecf20Sopenharmony_ci#define TXC_AMPDU_LAST 3 /* last (or single) MPDU of an A-MPDU */ 8058c2ecf20Sopenharmony_ci 8068c2ecf20Sopenharmony_ci/*== MacTxControlLow ==*/ 8078c2ecf20Sopenharmony_ci#define TXC_AMIC 0x8000 8088c2ecf20Sopenharmony_ci#define TXC_SENDCTS 0x0800 8098c2ecf20Sopenharmony_ci#define TXC_AMPDU_MASK 0x0600 8108c2ecf20Sopenharmony_ci#define TXC_BW_40 0x0100 8118c2ecf20Sopenharmony_ci#define TXC_FREQBAND_5G 0x0080 8128c2ecf20Sopenharmony_ci#define TXC_DFCS 0x0040 8138c2ecf20Sopenharmony_ci#define TXC_IGNOREPMQ 0x0020 8148c2ecf20Sopenharmony_ci#define TXC_HWSEQ 0x0010 8158c2ecf20Sopenharmony_ci#define TXC_STARTMSDU 0x0008 8168c2ecf20Sopenharmony_ci#define TXC_SENDRTS 0x0004 8178c2ecf20Sopenharmony_ci#define TXC_LONGFRAME 0x0002 8188c2ecf20Sopenharmony_ci#define TXC_IMMEDACK 0x0001 8198c2ecf20Sopenharmony_ci 8208c2ecf20Sopenharmony_ci/*== MacTxControlHigh ==*/ 8218c2ecf20Sopenharmony_ci/* RTS fallback preamble type 1 = SHORT 0 = LONG */ 8228c2ecf20Sopenharmony_ci#define TXC_PREAMBLE_RTS_FB_SHORT 0x8000 8238c2ecf20Sopenharmony_ci/* RTS main rate preamble type 1 = SHORT 0 = LONG */ 8248c2ecf20Sopenharmony_ci#define TXC_PREAMBLE_RTS_MAIN_SHORT 0x4000 8258c2ecf20Sopenharmony_ci/* 8268c2ecf20Sopenharmony_ci * Main fallback rate preamble type 8278c2ecf20Sopenharmony_ci * 1 = SHORT for OFDM/GF for MIMO 8288c2ecf20Sopenharmony_ci * 0 = LONG for CCK/MM for MIMO 8298c2ecf20Sopenharmony_ci */ 8308c2ecf20Sopenharmony_ci#define TXC_PREAMBLE_DATA_FB_SHORT 0x2000 8318c2ecf20Sopenharmony_ci 8328c2ecf20Sopenharmony_ci/* TXC_PREAMBLE_DATA_MAIN is in PhyTxControl bit 5 */ 8338c2ecf20Sopenharmony_ci/* use fallback rate for this AMPDU */ 8348c2ecf20Sopenharmony_ci#define TXC_AMPDU_FBR 0x1000 8358c2ecf20Sopenharmony_ci#define TXC_SECKEY_MASK 0x0FF0 8368c2ecf20Sopenharmony_ci#define TXC_SECKEY_SHIFT 4 8378c2ecf20Sopenharmony_ci/* Use alternate txpwr defined at loc. M_ALT_TXPWR_IDX */ 8388c2ecf20Sopenharmony_ci#define TXC_ALT_TXPWR 0x0008 8398c2ecf20Sopenharmony_ci#define TXC_SECTYPE_MASK 0x0007 8408c2ecf20Sopenharmony_ci#define TXC_SECTYPE_SHIFT 0 8418c2ecf20Sopenharmony_ci 8428c2ecf20Sopenharmony_ci/* Null delimiter for Fallback rate */ 8438c2ecf20Sopenharmony_ci#define AMPDU_FBR_NULL_DELIM 5 /* Location of Null delimiter count for AMPDU */ 8448c2ecf20Sopenharmony_ci 8458c2ecf20Sopenharmony_ci/* PhyTxControl for Mimophy */ 8468c2ecf20Sopenharmony_ci#define PHY_TXC_PWR_MASK 0xFC00 8478c2ecf20Sopenharmony_ci#define PHY_TXC_PWR_SHIFT 10 8488c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_MASK 0x03C0 /* bit 6, 7, 8, 9 */ 8498c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_SHIFT 6 8508c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_0_1 0x00C0 /* auto, last rx */ 8518c2ecf20Sopenharmony_ci#define PHY_TXC_LCNPHY_ANT_LAST 0x0000 8528c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_3 0x0200 /* virtual antenna 3 */ 8538c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_2 0x0100 /* virtual antenna 2 */ 8548c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_1 0x0080 /* virtual antenna 1 */ 8558c2ecf20Sopenharmony_ci#define PHY_TXC_ANT_0 0x0040 /* virtual antenna 0 */ 8568c2ecf20Sopenharmony_ci#define PHY_TXC_SHORT_HDR 0x0010 8578c2ecf20Sopenharmony_ci 8588c2ecf20Sopenharmony_ci#define PHY_TXC_OLD_ANT_0 0x0000 8598c2ecf20Sopenharmony_ci#define PHY_TXC_OLD_ANT_1 0x0100 8608c2ecf20Sopenharmony_ci#define PHY_TXC_OLD_ANT_LAST 0x0300 8618c2ecf20Sopenharmony_ci 8628c2ecf20Sopenharmony_ci/* PhyTxControl_1 for Mimophy */ 8638c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_MASK 0x0007 8648c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_10MHZ 0 8658c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_10MHZ_UP 1 8668c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_20MHZ 2 8678c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_20MHZ_UP 3 8688c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_40MHZ 4 8698c2ecf20Sopenharmony_ci#define PHY_TXC1_BW_40MHZ_DUP 5 8708c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_SHIFT 3 8718c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_MASK 0x0038 8728c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_SISO 0 8738c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_CDD 1 8748c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_STBC 2 8758c2ecf20Sopenharmony_ci#define PHY_TXC1_MODE_SDM 3 8768c2ecf20Sopenharmony_ci 8778c2ecf20Sopenharmony_ci/* PhyTxControl for HTphy that are different from Mimophy */ 8788c2ecf20Sopenharmony_ci#define PHY_TXC_HTANT_MASK 0x3fC0 /* bits 6-13 */ 8798c2ecf20Sopenharmony_ci 8808c2ecf20Sopenharmony_ci/* XtraFrameTypes */ 8818c2ecf20Sopenharmony_ci#define XFTS_RTS_FT_SHIFT 2 8828c2ecf20Sopenharmony_ci#define XFTS_FBRRTS_FT_SHIFT 4 8838c2ecf20Sopenharmony_ci#define XFTS_CHANNEL_SHIFT 8 8848c2ecf20Sopenharmony_ci 8858c2ecf20Sopenharmony_ci/* Antenna diversity bit in ant_wr_settle */ 8868c2ecf20Sopenharmony_ci#define PHY_AWS_ANTDIV 0x2000 8878c2ecf20Sopenharmony_ci 8888c2ecf20Sopenharmony_ci/* IFS ctl */ 8898c2ecf20Sopenharmony_ci#define IFS_USEEDCF (1 << 2) 8908c2ecf20Sopenharmony_ci 8918c2ecf20Sopenharmony_ci/* IFS ctl1 */ 8928c2ecf20Sopenharmony_ci#define IFS_CTL1_EDCRS (1 << 3) 8938c2ecf20Sopenharmony_ci#define IFS_CTL1_EDCRS_20L (1 << 4) 8948c2ecf20Sopenharmony_ci#define IFS_CTL1_EDCRS_40 (1 << 5) 8958c2ecf20Sopenharmony_ci 8968c2ecf20Sopenharmony_ci/* ABI_MimoAntSel */ 8978c2ecf20Sopenharmony_ci#define ABI_MAS_ADDR_BMP_IDX_MASK 0x0f00 8988c2ecf20Sopenharmony_ci#define ABI_MAS_ADDR_BMP_IDX_SHIFT 8 8998c2ecf20Sopenharmony_ci#define ABI_MAS_FBR_ANT_PTN_MASK 0x00f0 9008c2ecf20Sopenharmony_ci#define ABI_MAS_FBR_ANT_PTN_SHIFT 4 9018c2ecf20Sopenharmony_ci#define ABI_MAS_MRT_ANT_PTN_MASK 0x000f 9028c2ecf20Sopenharmony_ci 9038c2ecf20Sopenharmony_ci/* tx status packet */ 9048c2ecf20Sopenharmony_cistruct tx_status { 9058c2ecf20Sopenharmony_ci u16 framelen; 9068c2ecf20Sopenharmony_ci u16 PAD; 9078c2ecf20Sopenharmony_ci u16 frameid; 9088c2ecf20Sopenharmony_ci u16 status; 9098c2ecf20Sopenharmony_ci u16 lasttxtime; 9108c2ecf20Sopenharmony_ci u16 sequence; 9118c2ecf20Sopenharmony_ci u16 phyerr; 9128c2ecf20Sopenharmony_ci u16 ackphyrxsh; 9138c2ecf20Sopenharmony_ci} __packed; 9148c2ecf20Sopenharmony_ci 9158c2ecf20Sopenharmony_ci#define TXSTATUS_LEN 16 9168c2ecf20Sopenharmony_ci 9178c2ecf20Sopenharmony_ci/* status field bit definitions */ 9188c2ecf20Sopenharmony_ci#define TX_STATUS_FRM_RTX_MASK 0xF000 9198c2ecf20Sopenharmony_ci#define TX_STATUS_FRM_RTX_SHIFT 12 9208c2ecf20Sopenharmony_ci#define TX_STATUS_RTS_RTX_MASK 0x0F00 9218c2ecf20Sopenharmony_ci#define TX_STATUS_RTS_RTX_SHIFT 8 9228c2ecf20Sopenharmony_ci#define TX_STATUS_MASK 0x00FE 9238c2ecf20Sopenharmony_ci#define TX_STATUS_PMINDCTD (1 << 7) /* PM mode indicated to AP */ 9248c2ecf20Sopenharmony_ci#define TX_STATUS_INTERMEDIATE (1 << 6) /* intermediate or 1st ampdu pkg */ 9258c2ecf20Sopenharmony_ci#define TX_STATUS_AMPDU (1 << 5) /* AMPDU status */ 9268c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_MASK 0x1C /* suppress status bits (4:2) */ 9278c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_SHIFT 2 9288c2ecf20Sopenharmony_ci#define TX_STATUS_ACK_RCV (1 << 1) /* ACK received */ 9298c2ecf20Sopenharmony_ci#define TX_STATUS_VALID (1 << 0) /* Tx status valid */ 9308c2ecf20Sopenharmony_ci#define TX_STATUS_NO_ACK 0 9318c2ecf20Sopenharmony_ci 9328c2ecf20Sopenharmony_ci/* suppress status reason codes */ 9338c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_PMQ (1 << 2) /* PMQ entry */ 9348c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_FLUSH (2 << 2) /* flush request */ 9358c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_FRAG (3 << 2) /* previous frag failure */ 9368c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_TBTT (3 << 2) /* SHARED: Probe resp supr for TBTT */ 9378c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_BADCH (4 << 2) /* channel mismatch */ 9388c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_EXPTIME (5 << 2) /* lifetime expiry */ 9398c2ecf20Sopenharmony_ci#define TX_STATUS_SUPR_UF (6 << 2) /* underflow */ 9408c2ecf20Sopenharmony_ci 9418c2ecf20Sopenharmony_ci/* Unexpected tx status for rate update */ 9428c2ecf20Sopenharmony_ci#define TX_STATUS_UNEXP(status) \ 9438c2ecf20Sopenharmony_ci ((((status) & TX_STATUS_INTERMEDIATE) != 0) && \ 9448c2ecf20Sopenharmony_ci TX_STATUS_UNEXP_AMPDU(status)) 9458c2ecf20Sopenharmony_ci 9468c2ecf20Sopenharmony_ci/* Unexpected tx status for A-MPDU rate update */ 9478c2ecf20Sopenharmony_ci#define TX_STATUS_UNEXP_AMPDU(status) \ 9488c2ecf20Sopenharmony_ci ((((status) & TX_STATUS_SUPR_MASK) != 0) && \ 9498c2ecf20Sopenharmony_ci (((status) & TX_STATUS_SUPR_MASK) != TX_STATUS_SUPR_EXPTIME)) 9508c2ecf20Sopenharmony_ci 9518c2ecf20Sopenharmony_ci#define TX_STATUS_BA_BMAP03_MASK 0xF000 /* ba bitmap 0:3 in 1st pkg */ 9528c2ecf20Sopenharmony_ci#define TX_STATUS_BA_BMAP03_SHIFT 12 /* ba bitmap 0:3 in 1st pkg */ 9538c2ecf20Sopenharmony_ci#define TX_STATUS_BA_BMAP47_MASK 0x001E /* ba bitmap 4:7 in 2nd pkg */ 9548c2ecf20Sopenharmony_ci#define TX_STATUS_BA_BMAP47_SHIFT 3 /* ba bitmap 4:7 in 2nd pkg */ 9558c2ecf20Sopenharmony_ci 9568c2ecf20Sopenharmony_ci/* RXE (Receive Engine) */ 9578c2ecf20Sopenharmony_ci 9588c2ecf20Sopenharmony_ci/* RCM_CTL */ 9598c2ecf20Sopenharmony_ci#define RCM_INC_MASK_H 0x0080 9608c2ecf20Sopenharmony_ci#define RCM_INC_MASK_L 0x0040 9618c2ecf20Sopenharmony_ci#define RCM_INC_DATA 0x0020 9628c2ecf20Sopenharmony_ci#define RCM_INDEX_MASK 0x001F 9638c2ecf20Sopenharmony_ci#define RCM_SIZE 15 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ci#define RCM_MAC_OFFSET 0 /* current MAC address */ 9668c2ecf20Sopenharmony_ci#define RCM_BSSID_OFFSET 3 /* current BSSID address */ 9678c2ecf20Sopenharmony_ci#define RCM_F_BSSID_0_OFFSET 6 /* foreign BSS CFP tracking */ 9688c2ecf20Sopenharmony_ci#define RCM_F_BSSID_1_OFFSET 9 /* foreign BSS CFP tracking */ 9698c2ecf20Sopenharmony_ci#define RCM_F_BSSID_2_OFFSET 12 /* foreign BSS CFP tracking */ 9708c2ecf20Sopenharmony_ci 9718c2ecf20Sopenharmony_ci#define RCM_WEP_TA0_OFFSET 16 9728c2ecf20Sopenharmony_ci#define RCM_WEP_TA1_OFFSET 19 9738c2ecf20Sopenharmony_ci#define RCM_WEP_TA2_OFFSET 22 9748c2ecf20Sopenharmony_ci#define RCM_WEP_TA3_OFFSET 25 9758c2ecf20Sopenharmony_ci 9768c2ecf20Sopenharmony_ci/* PSM Block */ 9778c2ecf20Sopenharmony_ci 9788c2ecf20Sopenharmony_ci/* psm_phy_hdr_param bits */ 9798c2ecf20Sopenharmony_ci#define MAC_PHY_RESET 1 9808c2ecf20Sopenharmony_ci#define MAC_PHY_CLOCK_EN 2 9818c2ecf20Sopenharmony_ci#define MAC_PHY_FORCE_CLK 4 9828c2ecf20Sopenharmony_ci 9838c2ecf20Sopenharmony_ci/* WEP Block */ 9848c2ecf20Sopenharmony_ci 9858c2ecf20Sopenharmony_ci/* WEP_WKEY */ 9868c2ecf20Sopenharmony_ci#define WKEY_START (1 << 8) 9878c2ecf20Sopenharmony_ci#define WKEY_SEL_MASK 0x1F 9888c2ecf20Sopenharmony_ci 9898c2ecf20Sopenharmony_ci/* WEP data formats */ 9908c2ecf20Sopenharmony_ci 9918c2ecf20Sopenharmony_ci/* the number of RCMTA entries */ 9928c2ecf20Sopenharmony_ci#define RCMTA_SIZE 50 9938c2ecf20Sopenharmony_ci 9948c2ecf20Sopenharmony_ci#define M_ADDR_BMP_BLK (0x37e * 2) 9958c2ecf20Sopenharmony_ci#define M_ADDR_BMP_BLK_SZ 12 9968c2ecf20Sopenharmony_ci 9978c2ecf20Sopenharmony_ci#define ADDR_BMP_RA (1 << 0) /* Receiver Address (RA) */ 9988c2ecf20Sopenharmony_ci#define ADDR_BMP_TA (1 << 1) /* Transmitter Address (TA) */ 9998c2ecf20Sopenharmony_ci#define ADDR_BMP_BSSID (1 << 2) /* BSSID */ 10008c2ecf20Sopenharmony_ci#define ADDR_BMP_AP (1 << 3) /* Infra-BSS Access Point */ 10018c2ecf20Sopenharmony_ci#define ADDR_BMP_STA (1 << 4) /* Infra-BSS Station */ 10028c2ecf20Sopenharmony_ci#define ADDR_BMP_RESERVED1 (1 << 5) 10038c2ecf20Sopenharmony_ci#define ADDR_BMP_RESERVED2 (1 << 6) 10048c2ecf20Sopenharmony_ci#define ADDR_BMP_RESERVED3 (1 << 7) 10058c2ecf20Sopenharmony_ci#define ADDR_BMP_BSS_IDX_MASK (3 << 8) /* BSS control block index */ 10068c2ecf20Sopenharmony_ci#define ADDR_BMP_BSS_IDX_SHIFT 8 10078c2ecf20Sopenharmony_ci 10088c2ecf20Sopenharmony_ci#define WSEC_MAX_RCMTA_KEYS 54 10098c2ecf20Sopenharmony_ci 10108c2ecf20Sopenharmony_ci/* max keys in M_TKMICKEYS_BLK */ 10118c2ecf20Sopenharmony_ci#define WSEC_MAX_TKMIC_ENGINE_KEYS 12 /* 8 + 4 default */ 10128c2ecf20Sopenharmony_ci 10138c2ecf20Sopenharmony_ci/* max RXE match registers */ 10148c2ecf20Sopenharmony_ci#define WSEC_MAX_RXE_KEYS 4 10158c2ecf20Sopenharmony_ci 10168c2ecf20Sopenharmony_ci/* SECKINDXALGO (Security Key Index & Algorithm Block) word format */ 10178c2ecf20Sopenharmony_ci/* SKL (Security Key Lookup) */ 10188c2ecf20Sopenharmony_ci#define SKL_ALGO_MASK 0x0007 10198c2ecf20Sopenharmony_ci#define SKL_ALGO_SHIFT 0 10208c2ecf20Sopenharmony_ci#define SKL_KEYID_MASK 0x0008 10218c2ecf20Sopenharmony_ci#define SKL_KEYID_SHIFT 3 10228c2ecf20Sopenharmony_ci#define SKL_INDEX_MASK 0x03F0 10238c2ecf20Sopenharmony_ci#define SKL_INDEX_SHIFT 4 10248c2ecf20Sopenharmony_ci#define SKL_GRP_ALGO_MASK 0x1c00 10258c2ecf20Sopenharmony_ci#define SKL_GRP_ALGO_SHIFT 10 10268c2ecf20Sopenharmony_ci 10278c2ecf20Sopenharmony_ci/* additional bits defined for IBSS group key support */ 10288c2ecf20Sopenharmony_ci#define SKL_IBSS_INDEX_MASK 0x01F0 10298c2ecf20Sopenharmony_ci#define SKL_IBSS_INDEX_SHIFT 4 10308c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYID1_MASK 0x0600 10318c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYID1_SHIFT 9 10328c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYID2_MASK 0x1800 10338c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYID2_SHIFT 11 10348c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYALGO_MASK 0xE000 10358c2ecf20Sopenharmony_ci#define SKL_IBSS_KEYALGO_SHIFT 13 10368c2ecf20Sopenharmony_ci 10378c2ecf20Sopenharmony_ci#define WSEC_MODE_OFF 0 10388c2ecf20Sopenharmony_ci#define WSEC_MODE_HW 1 10398c2ecf20Sopenharmony_ci#define WSEC_MODE_SW 2 10408c2ecf20Sopenharmony_ci 10418c2ecf20Sopenharmony_ci#define WSEC_ALGO_OFF 0 10428c2ecf20Sopenharmony_ci#define WSEC_ALGO_WEP1 1 10438c2ecf20Sopenharmony_ci#define WSEC_ALGO_TKIP 2 10448c2ecf20Sopenharmony_ci#define WSEC_ALGO_AES 3 10458c2ecf20Sopenharmony_ci#define WSEC_ALGO_WEP128 4 10468c2ecf20Sopenharmony_ci#define WSEC_ALGO_AES_LEGACY 5 10478c2ecf20Sopenharmony_ci#define WSEC_ALGO_NALG 6 10488c2ecf20Sopenharmony_ci 10498c2ecf20Sopenharmony_ci#define AES_MODE_NONE 0 10508c2ecf20Sopenharmony_ci#define AES_MODE_CCM 1 10518c2ecf20Sopenharmony_ci 10528c2ecf20Sopenharmony_ci/* WEP_CTL (Rev 0) */ 10538c2ecf20Sopenharmony_ci#define WECR0_KEYREG_SHIFT 0 10548c2ecf20Sopenharmony_ci#define WECR0_KEYREG_MASK 0x7 10558c2ecf20Sopenharmony_ci#define WECR0_DECRYPT (1 << 3) 10568c2ecf20Sopenharmony_ci#define WECR0_IVINLINE (1 << 4) 10578c2ecf20Sopenharmony_ci#define WECR0_WEPALG_SHIFT 5 10588c2ecf20Sopenharmony_ci#define WECR0_WEPALG_MASK (0x7 << 5) 10598c2ecf20Sopenharmony_ci#define WECR0_WKEYSEL_SHIFT 8 10608c2ecf20Sopenharmony_ci#define WECR0_WKEYSEL_MASK (0x7 << 8) 10618c2ecf20Sopenharmony_ci#define WECR0_WKEYSTART (1 << 11) 10628c2ecf20Sopenharmony_ci#define WECR0_WEPINIT (1 << 14) 10638c2ecf20Sopenharmony_ci#define WECR0_ICVERR (1 << 15) 10648c2ecf20Sopenharmony_ci 10658c2ecf20Sopenharmony_ci/* Frame template map byte offsets */ 10668c2ecf20Sopenharmony_ci#define T_ACTS_TPL_BASE (0) 10678c2ecf20Sopenharmony_ci#define T_NULL_TPL_BASE (0xc * 2) 10688c2ecf20Sopenharmony_ci#define T_QNULL_TPL_BASE (0x1c * 2) 10698c2ecf20Sopenharmony_ci#define T_RR_TPL_BASE (0x2c * 2) 10708c2ecf20Sopenharmony_ci#define T_BCN0_TPL_BASE (0x34 * 2) 10718c2ecf20Sopenharmony_ci#define T_PRS_TPL_BASE (0x134 * 2) 10728c2ecf20Sopenharmony_ci#define T_BCN1_TPL_BASE (0x234 * 2) 10738c2ecf20Sopenharmony_ci#define T_TX_FIFO_TXRAM_BASE (T_ACTS_TPL_BASE + \ 10748c2ecf20Sopenharmony_ci (TXFIFO_START_BLK * TXFIFO_SIZE_UNIT)) 10758c2ecf20Sopenharmony_ci 10768c2ecf20Sopenharmony_ci#define T_BA_TPL_BASE T_QNULL_TPL_BASE /* template area for BA */ 10778c2ecf20Sopenharmony_ci 10788c2ecf20Sopenharmony_ci#define T_RAM_ACCESS_SZ 4 /* template ram is 4 byte access only */ 10798c2ecf20Sopenharmony_ci 10808c2ecf20Sopenharmony_ci/* Shared Mem byte offsets */ 10818c2ecf20Sopenharmony_ci 10828c2ecf20Sopenharmony_ci/* Location where the ucode expects the corerev */ 10838c2ecf20Sopenharmony_ci#define M_MACHW_VER (0x00b * 2) 10848c2ecf20Sopenharmony_ci 10858c2ecf20Sopenharmony_ci/* Location where the ucode expects the MAC capabilities */ 10868c2ecf20Sopenharmony_ci#define M_MACHW_CAP_L (0x060 * 2) 10878c2ecf20Sopenharmony_ci#define M_MACHW_CAP_H (0x061 * 2) 10888c2ecf20Sopenharmony_ci 10898c2ecf20Sopenharmony_ci/* WME shared memory */ 10908c2ecf20Sopenharmony_ci#define M_EDCF_STATUS_OFF (0x007 * 2) 10918c2ecf20Sopenharmony_ci#define M_TXF_CUR_INDEX (0x018 * 2) 10928c2ecf20Sopenharmony_ci#define M_EDCF_QINFO (0x120 * 2) 10938c2ecf20Sopenharmony_ci 10948c2ecf20Sopenharmony_ci/* PS-mode related parameters */ 10958c2ecf20Sopenharmony_ci#define M_DOT11_SLOT (0x008 * 2) 10968c2ecf20Sopenharmony_ci#define M_DOT11_DTIMPERIOD (0x009 * 2) 10978c2ecf20Sopenharmony_ci#define M_NOSLPZNATDTIM (0x026 * 2) 10988c2ecf20Sopenharmony_ci 10998c2ecf20Sopenharmony_ci/* Beacon-related parameters */ 11008c2ecf20Sopenharmony_ci#define M_BCN0_FRM_BYTESZ (0x00c * 2) /* Bcn 0 template length */ 11018c2ecf20Sopenharmony_ci#define M_BCN1_FRM_BYTESZ (0x00d * 2) /* Bcn 1 template length */ 11028c2ecf20Sopenharmony_ci#define M_BCN_TXTSF_OFFSET (0x00e * 2) 11038c2ecf20Sopenharmony_ci#define M_TIMBPOS_INBEACON (0x00f * 2) 11048c2ecf20Sopenharmony_ci#define M_SFRMTXCNTFBRTHSD (0x022 * 2) 11058c2ecf20Sopenharmony_ci#define M_LFRMTXCNTFBRTHSD (0x023 * 2) 11068c2ecf20Sopenharmony_ci#define M_BCN_PCTLWD (0x02a * 2) 11078c2ecf20Sopenharmony_ci#define M_BCN_LI (0x05b * 2) /* beacon listen interval */ 11088c2ecf20Sopenharmony_ci 11098c2ecf20Sopenharmony_ci/* MAX Rx Frame len */ 11108c2ecf20Sopenharmony_ci#define M_MAXRXFRM_LEN (0x010 * 2) 11118c2ecf20Sopenharmony_ci 11128c2ecf20Sopenharmony_ci/* ACK/CTS related params */ 11138c2ecf20Sopenharmony_ci#define M_RSP_PCTLWD (0x011 * 2) 11148c2ecf20Sopenharmony_ci 11158c2ecf20Sopenharmony_ci/* Hardware Power Control */ 11168c2ecf20Sopenharmony_ci#define M_TXPWR_N (0x012 * 2) 11178c2ecf20Sopenharmony_ci#define M_TXPWR_TARGET (0x013 * 2) 11188c2ecf20Sopenharmony_ci#define M_TXPWR_MAX (0x014 * 2) 11198c2ecf20Sopenharmony_ci#define M_TXPWR_CUR (0x019 * 2) 11208c2ecf20Sopenharmony_ci 11218c2ecf20Sopenharmony_ci/* Rx-related parameters */ 11228c2ecf20Sopenharmony_ci#define M_RX_PAD_DATA_OFFSET (0x01a * 2) 11238c2ecf20Sopenharmony_ci 11248c2ecf20Sopenharmony_ci/* WEP Shared mem data */ 11258c2ecf20Sopenharmony_ci#define M_SEC_DEFIVLOC (0x01e * 2) 11268c2ecf20Sopenharmony_ci#define M_SEC_VALNUMSOFTMCHTA (0x01f * 2) 11278c2ecf20Sopenharmony_ci#define M_PHYVER (0x028 * 2) 11288c2ecf20Sopenharmony_ci#define M_PHYTYPE (0x029 * 2) 11298c2ecf20Sopenharmony_ci#define M_SECRXKEYS_PTR (0x02b * 2) 11308c2ecf20Sopenharmony_ci#define M_TKMICKEYS_PTR (0x059 * 2) 11318c2ecf20Sopenharmony_ci#define M_SECKINDXALGO_BLK (0x2ea * 2) 11328c2ecf20Sopenharmony_ci#define M_SECKINDXALGO_BLK_SZ 54 11338c2ecf20Sopenharmony_ci#define M_SECPSMRXTAMCH_BLK (0x2fa * 2) 11348c2ecf20Sopenharmony_ci#define M_TKIP_TSC_TTAK (0x18c * 2) 11358c2ecf20Sopenharmony_ci#define D11_MAX_KEY_SIZE 16 11368c2ecf20Sopenharmony_ci 11378c2ecf20Sopenharmony_ci#define M_MAX_ANTCNT (0x02e * 2) /* antenna swap threshold */ 11388c2ecf20Sopenharmony_ci 11398c2ecf20Sopenharmony_ci/* Probe response related parameters */ 11408c2ecf20Sopenharmony_ci#define M_SSIDLEN (0x024 * 2) 11418c2ecf20Sopenharmony_ci#define M_PRB_RESP_FRM_LEN (0x025 * 2) 11428c2ecf20Sopenharmony_ci#define M_PRS_MAXTIME (0x03a * 2) 11438c2ecf20Sopenharmony_ci#define M_SSID (0xb0 * 2) 11448c2ecf20Sopenharmony_ci#define M_CTXPRS_BLK (0xc0 * 2) 11458c2ecf20Sopenharmony_ci#define C_CTX_PCTLWD_POS (0x4 * 2) 11468c2ecf20Sopenharmony_ci 11478c2ecf20Sopenharmony_ci/* Delta between OFDM and CCK power in CCK power boost mode */ 11488c2ecf20Sopenharmony_ci#define M_OFDM_OFFSET (0x027 * 2) 11498c2ecf20Sopenharmony_ci 11508c2ecf20Sopenharmony_ci/* TSSI for last 4 11b/g CCK packets transmitted */ 11518c2ecf20Sopenharmony_ci#define M_B_TSSI_0 (0x02c * 2) 11528c2ecf20Sopenharmony_ci#define M_B_TSSI_1 (0x02d * 2) 11538c2ecf20Sopenharmony_ci 11548c2ecf20Sopenharmony_ci/* Host flags to turn on ucode options */ 11558c2ecf20Sopenharmony_ci#define M_HOST_FLAGS1 (0x02f * 2) 11568c2ecf20Sopenharmony_ci#define M_HOST_FLAGS2 (0x030 * 2) 11578c2ecf20Sopenharmony_ci#define M_HOST_FLAGS3 (0x031 * 2) 11588c2ecf20Sopenharmony_ci#define M_HOST_FLAGS4 (0x03c * 2) 11598c2ecf20Sopenharmony_ci#define M_HOST_FLAGS5 (0x06a * 2) 11608c2ecf20Sopenharmony_ci#define M_HOST_FLAGS_SZ 16 11618c2ecf20Sopenharmony_ci 11628c2ecf20Sopenharmony_ci#define M_RADAR_REG (0x033 * 2) 11638c2ecf20Sopenharmony_ci 11648c2ecf20Sopenharmony_ci/* TSSI for last 4 11a OFDM packets transmitted */ 11658c2ecf20Sopenharmony_ci#define M_A_TSSI_0 (0x034 * 2) 11668c2ecf20Sopenharmony_ci#define M_A_TSSI_1 (0x035 * 2) 11678c2ecf20Sopenharmony_ci 11688c2ecf20Sopenharmony_ci/* noise interference measurement */ 11698c2ecf20Sopenharmony_ci#define M_NOISE_IF_COUNT (0x034 * 2) 11708c2ecf20Sopenharmony_ci#define M_NOISE_IF_TIMEOUT (0x035 * 2) 11718c2ecf20Sopenharmony_ci 11728c2ecf20Sopenharmony_ci#define M_RF_RX_SP_REG1 (0x036 * 2) 11738c2ecf20Sopenharmony_ci 11748c2ecf20Sopenharmony_ci/* TSSI for last 4 11g OFDM packets transmitted */ 11758c2ecf20Sopenharmony_ci#define M_G_TSSI_0 (0x038 * 2) 11768c2ecf20Sopenharmony_ci#define M_G_TSSI_1 (0x039 * 2) 11778c2ecf20Sopenharmony_ci 11788c2ecf20Sopenharmony_ci/* Background noise measure */ 11798c2ecf20Sopenharmony_ci#define M_JSSI_0 (0x44 * 2) 11808c2ecf20Sopenharmony_ci#define M_JSSI_1 (0x45 * 2) 11818c2ecf20Sopenharmony_ci#define M_JSSI_AUX (0x46 * 2) 11828c2ecf20Sopenharmony_ci 11838c2ecf20Sopenharmony_ci#define M_CUR_2050_RADIOCODE (0x47 * 2) 11848c2ecf20Sopenharmony_ci 11858c2ecf20Sopenharmony_ci/* TX fifo sizes */ 11868c2ecf20Sopenharmony_ci#define M_FIFOSIZE0 (0x4c * 2) 11878c2ecf20Sopenharmony_ci#define M_FIFOSIZE1 (0x4d * 2) 11888c2ecf20Sopenharmony_ci#define M_FIFOSIZE2 (0x4e * 2) 11898c2ecf20Sopenharmony_ci#define M_FIFOSIZE3 (0x4f * 2) 11908c2ecf20Sopenharmony_ci#define D11_MAX_TX_FRMS 32 /* max frames allowed in tx fifo */ 11918c2ecf20Sopenharmony_ci 11928c2ecf20Sopenharmony_ci/* Current channel number plus upper bits */ 11938c2ecf20Sopenharmony_ci#define M_CURCHANNEL (0x50 * 2) 11948c2ecf20Sopenharmony_ci#define D11_CURCHANNEL_5G 0x0100; 11958c2ecf20Sopenharmony_ci#define D11_CURCHANNEL_40 0x0200; 11968c2ecf20Sopenharmony_ci#define D11_CURCHANNEL_MAX 0x00FF; 11978c2ecf20Sopenharmony_ci 11988c2ecf20Sopenharmony_ci/* last posted frameid on the bcmc fifo */ 11998c2ecf20Sopenharmony_ci#define M_BCMC_FID (0x54 * 2) 12008c2ecf20Sopenharmony_ci#define INVALIDFID 0xffff 12018c2ecf20Sopenharmony_ci 12028c2ecf20Sopenharmony_ci/* extended beacon phyctl bytes for 11N */ 12038c2ecf20Sopenharmony_ci#define M_BCN_PCTL1WD (0x058 * 2) 12048c2ecf20Sopenharmony_ci 12058c2ecf20Sopenharmony_ci/* idle busy ratio to duty_cycle requirement */ 12068c2ecf20Sopenharmony_ci#define M_TX_IDLE_BUSY_RATIO_X_16_CCK (0x52 * 2) 12078c2ecf20Sopenharmony_ci#define M_TX_IDLE_BUSY_RATIO_X_16_OFDM (0x5A * 2) 12088c2ecf20Sopenharmony_ci 12098c2ecf20Sopenharmony_ci/* CW RSSI for LCNPHY */ 12108c2ecf20Sopenharmony_ci#define M_LCN_RSSI_0 0x1332 12118c2ecf20Sopenharmony_ci#define M_LCN_RSSI_1 0x1338 12128c2ecf20Sopenharmony_ci#define M_LCN_RSSI_2 0x133e 12138c2ecf20Sopenharmony_ci#define M_LCN_RSSI_3 0x1344 12148c2ecf20Sopenharmony_ci 12158c2ecf20Sopenharmony_ci/* SNR for LCNPHY */ 12168c2ecf20Sopenharmony_ci#define M_LCN_SNR_A_0 0x1334 12178c2ecf20Sopenharmony_ci#define M_LCN_SNR_B_0 0x1336 12188c2ecf20Sopenharmony_ci 12198c2ecf20Sopenharmony_ci#define M_LCN_SNR_A_1 0x133a 12208c2ecf20Sopenharmony_ci#define M_LCN_SNR_B_1 0x133c 12218c2ecf20Sopenharmony_ci 12228c2ecf20Sopenharmony_ci#define M_LCN_SNR_A_2 0x1340 12238c2ecf20Sopenharmony_ci#define M_LCN_SNR_B_2 0x1342 12248c2ecf20Sopenharmony_ci 12258c2ecf20Sopenharmony_ci#define M_LCN_SNR_A_3 0x1346 12268c2ecf20Sopenharmony_ci#define M_LCN_SNR_B_3 0x1348 12278c2ecf20Sopenharmony_ci 12288c2ecf20Sopenharmony_ci#define M_LCN_LAST_RESET (81*2) 12298c2ecf20Sopenharmony_ci#define M_LCN_LAST_LOC (63*2) 12308c2ecf20Sopenharmony_ci#define M_LCNPHY_RESET_STATUS (4902) 12318c2ecf20Sopenharmony_ci#define M_LCNPHY_DSC_TIME (0x98d*2) 12328c2ecf20Sopenharmony_ci#define M_LCNPHY_RESET_CNT_DSC (0x98b*2) 12338c2ecf20Sopenharmony_ci#define M_LCNPHY_RESET_CNT (0x98c*2) 12348c2ecf20Sopenharmony_ci 12358c2ecf20Sopenharmony_ci/* Rate table offsets */ 12368c2ecf20Sopenharmony_ci#define M_RT_DIRMAP_A (0xe0 * 2) 12378c2ecf20Sopenharmony_ci#define M_RT_BBRSMAP_A (0xf0 * 2) 12388c2ecf20Sopenharmony_ci#define M_RT_DIRMAP_B (0x100 * 2) 12398c2ecf20Sopenharmony_ci#define M_RT_BBRSMAP_B (0x110 * 2) 12408c2ecf20Sopenharmony_ci 12418c2ecf20Sopenharmony_ci/* Rate table entry offsets */ 12428c2ecf20Sopenharmony_ci#define M_RT_PRS_PLCP_POS 10 12438c2ecf20Sopenharmony_ci#define M_RT_PRS_DUR_POS 16 12448c2ecf20Sopenharmony_ci#define M_RT_OFDM_PCTL1_POS 18 12458c2ecf20Sopenharmony_ci 12468c2ecf20Sopenharmony_ci#define M_20IN40_IQ (0x380 * 2) 12478c2ecf20Sopenharmony_ci 12488c2ecf20Sopenharmony_ci/* SHM locations where ucode stores the current power index */ 12498c2ecf20Sopenharmony_ci#define M_CURR_IDX1 (0x384 * 2) 12508c2ecf20Sopenharmony_ci#define M_CURR_IDX2 (0x387 * 2) 12518c2ecf20Sopenharmony_ci 12528c2ecf20Sopenharmony_ci#define M_BSCALE_ANT0 (0x5e * 2) 12538c2ecf20Sopenharmony_ci#define M_BSCALE_ANT1 (0x5f * 2) 12548c2ecf20Sopenharmony_ci 12558c2ecf20Sopenharmony_ci/* Antenna Diversity Testing */ 12568c2ecf20Sopenharmony_ci#define M_MIMO_ANTSEL_RXDFLT (0x63 * 2) 12578c2ecf20Sopenharmony_ci#define M_ANTSEL_CLKDIV (0x61 * 2) 12588c2ecf20Sopenharmony_ci#define M_MIMO_ANTSEL_TXDFLT (0x64 * 2) 12598c2ecf20Sopenharmony_ci 12608c2ecf20Sopenharmony_ci#define M_MIMO_MAXSYM (0x5d * 2) 12618c2ecf20Sopenharmony_ci#define MIMO_MAXSYM_DEF 0x8000 /* 32k */ 12628c2ecf20Sopenharmony_ci#define MIMO_MAXSYM_MAX 0xffff /* 64k */ 12638c2ecf20Sopenharmony_ci 12648c2ecf20Sopenharmony_ci#define M_WATCHDOG_8TU (0x1e * 2) 12658c2ecf20Sopenharmony_ci#define WATCHDOG_8TU_DEF 5 12668c2ecf20Sopenharmony_ci#define WATCHDOG_8TU_MAX 10 12678c2ecf20Sopenharmony_ci 12688c2ecf20Sopenharmony_ci/* Manufacturing Test Variables */ 12698c2ecf20Sopenharmony_ci/* PER test mode */ 12708c2ecf20Sopenharmony_ci#define M_PKTENG_CTRL (0x6c * 2) 12718c2ecf20Sopenharmony_ci/* IFS for TX mode */ 12728c2ecf20Sopenharmony_ci#define M_PKTENG_IFS (0x6d * 2) 12738c2ecf20Sopenharmony_ci/* Lower word of tx frmcnt/rx lostcnt */ 12748c2ecf20Sopenharmony_ci#define M_PKTENG_FRMCNT_LO (0x6e * 2) 12758c2ecf20Sopenharmony_ci/* Upper word of tx frmcnt/rx lostcnt */ 12768c2ecf20Sopenharmony_ci#define M_PKTENG_FRMCNT_HI (0x6f * 2) 12778c2ecf20Sopenharmony_ci 12788c2ecf20Sopenharmony_ci/* Index variation in vbat ripple */ 12798c2ecf20Sopenharmony_ci#define M_LCN_PWR_IDX_MAX (0x67 * 2) /* highest index read by ucode */ 12808c2ecf20Sopenharmony_ci#define M_LCN_PWR_IDX_MIN (0x66 * 2) /* lowest index read by ucode */ 12818c2ecf20Sopenharmony_ci 12828c2ecf20Sopenharmony_ci/* M_PKTENG_CTRL bit definitions */ 12838c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_TX 0x0001 12848c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_TX_RIFS 0x0004 12858c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_TX_CTS 0x0008 12868c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_RX 0x0002 12878c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_RX_WITH_ACK 0x0402 12888c2ecf20Sopenharmony_ci#define M_PKTENG_MODE_MASK 0x0003 12898c2ecf20Sopenharmony_ci/* TX frames indicated in the frmcnt reg */ 12908c2ecf20Sopenharmony_ci#define M_PKTENG_FRMCNT_VLD 0x0100 12918c2ecf20Sopenharmony_ci 12928c2ecf20Sopenharmony_ci/* Sample Collect parameters (bitmap and type) */ 12938c2ecf20Sopenharmony_ci/* Trigger bitmap for sample collect */ 12948c2ecf20Sopenharmony_ci#define M_SMPL_COL_BMP (0x37d * 2) 12958c2ecf20Sopenharmony_ci/* Sample collect type */ 12968c2ecf20Sopenharmony_ci#define M_SMPL_COL_CTL (0x3b2 * 2) 12978c2ecf20Sopenharmony_ci 12988c2ecf20Sopenharmony_ci#define ANTSEL_CLKDIV_4MHZ 6 12998c2ecf20Sopenharmony_ci#define MIMO_ANTSEL_BUSY 0x4000 /* bit 14 (busy) */ 13008c2ecf20Sopenharmony_ci#define MIMO_ANTSEL_SEL 0x8000 /* bit 15 write the value */ 13018c2ecf20Sopenharmony_ci#define MIMO_ANTSEL_WAIT 50 /* 50us wait */ 13028c2ecf20Sopenharmony_ci#define MIMO_ANTSEL_OVERRIDE 0x8000 /* flag */ 13038c2ecf20Sopenharmony_ci 13048c2ecf20Sopenharmony_cistruct shm_acparams { 13058c2ecf20Sopenharmony_ci u16 txop; 13068c2ecf20Sopenharmony_ci u16 cwmin; 13078c2ecf20Sopenharmony_ci u16 cwmax; 13088c2ecf20Sopenharmony_ci u16 cwcur; 13098c2ecf20Sopenharmony_ci u16 aifs; 13108c2ecf20Sopenharmony_ci u16 bslots; 13118c2ecf20Sopenharmony_ci u16 reggap; 13128c2ecf20Sopenharmony_ci u16 status; 13138c2ecf20Sopenharmony_ci u16 rsvd[8]; 13148c2ecf20Sopenharmony_ci} __packed; 13158c2ecf20Sopenharmony_ci#define M_EDCF_QLEN (16 * 2) 13168c2ecf20Sopenharmony_ci 13178c2ecf20Sopenharmony_ci#define WME_STATUS_NEWAC (1 << 8) 13188c2ecf20Sopenharmony_ci 13198c2ecf20Sopenharmony_ci/* M_HOST_FLAGS */ 13208c2ecf20Sopenharmony_ci#define MHFMAX 5 /* Number of valid hostflag half-word (u16) */ 13218c2ecf20Sopenharmony_ci#define MHF1 0 /* Hostflag 1 index */ 13228c2ecf20Sopenharmony_ci#define MHF2 1 /* Hostflag 2 index */ 13238c2ecf20Sopenharmony_ci#define MHF3 2 /* Hostflag 3 index */ 13248c2ecf20Sopenharmony_ci#define MHF4 3 /* Hostflag 4 index */ 13258c2ecf20Sopenharmony_ci#define MHF5 4 /* Hostflag 5 index */ 13268c2ecf20Sopenharmony_ci 13278c2ecf20Sopenharmony_ci/* Flags in M_HOST_FLAGS */ 13288c2ecf20Sopenharmony_ci/* Enable ucode antenna diversity help */ 13298c2ecf20Sopenharmony_ci#define MHF1_ANTDIV 0x0001 13308c2ecf20Sopenharmony_ci/* Enable EDCF access control */ 13318c2ecf20Sopenharmony_ci#define MHF1_EDCF 0x0100 13328c2ecf20Sopenharmony_ci#define MHF1_IQSWAP_WAR 0x0200 13338c2ecf20Sopenharmony_ci/* Disable Slow clock request, for corerev < 11 */ 13348c2ecf20Sopenharmony_ci#define MHF1_FORCEFASTCLK 0x0400 13358c2ecf20Sopenharmony_ci 13368c2ecf20Sopenharmony_ci/* Flags in M_HOST_FLAGS2 */ 13378c2ecf20Sopenharmony_ci 13388c2ecf20Sopenharmony_ci/* Flush BCMC FIFO immediately */ 13398c2ecf20Sopenharmony_ci#define MHF2_TXBCMC_NOW 0x0040 13408c2ecf20Sopenharmony_ci/* Enable ucode/hw power control */ 13418c2ecf20Sopenharmony_ci#define MHF2_HWPWRCTL 0x0080 13428c2ecf20Sopenharmony_ci#define MHF2_NPHY40MHZ_WAR 0x0800 13438c2ecf20Sopenharmony_ci 13448c2ecf20Sopenharmony_ci/* Flags in M_HOST_FLAGS3 */ 13458c2ecf20Sopenharmony_ci/* enabled mimo antenna selection */ 13468c2ecf20Sopenharmony_ci#define MHF3_ANTSEL_EN 0x0001 13478c2ecf20Sopenharmony_ci/* antenna selection mode: 0: 2x3, 1: 2x4 */ 13488c2ecf20Sopenharmony_ci#define MHF3_ANTSEL_MODE 0x0002 13498c2ecf20Sopenharmony_ci#define MHF3_RESERVED1 0x0004 13508c2ecf20Sopenharmony_ci#define MHF3_RESERVED2 0x0008 13518c2ecf20Sopenharmony_ci#define MHF3_NPHY_MLADV_WAR 0x0010 13528c2ecf20Sopenharmony_ci 13538c2ecf20Sopenharmony_ci/* Flags in M_HOST_FLAGS4 */ 13548c2ecf20Sopenharmony_ci/* force bphy Tx on core 0 (board level WAR) */ 13558c2ecf20Sopenharmony_ci#define MHF4_BPHY_TXCORE0 0x0080 13568c2ecf20Sopenharmony_ci/* for 4313A0 FEM boards */ 13578c2ecf20Sopenharmony_ci#define MHF4_EXTPA_ENABLE 0x4000 13588c2ecf20Sopenharmony_ci 13598c2ecf20Sopenharmony_ci/* Flags in M_HOST_FLAGS5 */ 13608c2ecf20Sopenharmony_ci#define MHF5_4313_GPIOCTRL 0x0001 13618c2ecf20Sopenharmony_ci#define MHF5_RESERVED1 0x0002 13628c2ecf20Sopenharmony_ci#define MHF5_RESERVED2 0x0004 13638c2ecf20Sopenharmony_ci/* Radio power setting for ucode */ 13648c2ecf20Sopenharmony_ci#define M_RADIO_PWR (0x32 * 2) 13658c2ecf20Sopenharmony_ci 13668c2ecf20Sopenharmony_ci/* phy noise recorded by ucode right after tx */ 13678c2ecf20Sopenharmony_ci#define M_PHY_NOISE (0x037 * 2) 13688c2ecf20Sopenharmony_ci#define PHY_NOISE_MASK 0x00ff 13698c2ecf20Sopenharmony_ci 13708c2ecf20Sopenharmony_ci/* 13718c2ecf20Sopenharmony_ci * Receive Frame Data Header for 802.11b DCF-only frames 13728c2ecf20Sopenharmony_ci * 13738c2ecf20Sopenharmony_ci * RxFrameSize: Actual byte length of the frame data received 13748c2ecf20Sopenharmony_ci * PAD: padding (not used) 13758c2ecf20Sopenharmony_ci * PhyRxStatus_0: PhyRxStatus 15:0 13768c2ecf20Sopenharmony_ci * PhyRxStatus_1: PhyRxStatus 31:16 13778c2ecf20Sopenharmony_ci * PhyRxStatus_2: PhyRxStatus 47:32 13788c2ecf20Sopenharmony_ci * PhyRxStatus_3: PhyRxStatus 63:48 13798c2ecf20Sopenharmony_ci * PhyRxStatus_4: PhyRxStatus 79:64 13808c2ecf20Sopenharmony_ci * PhyRxStatus_5: PhyRxStatus 95:80 13818c2ecf20Sopenharmony_ci * RxStatus1: MAC Rx Status 13828c2ecf20Sopenharmony_ci * RxStatus2: extended MAC Rx status 13838c2ecf20Sopenharmony_ci * RxTSFTime: RxTSFTime time of first MAC symbol + M_PHY_PLCPRX_DLY 13848c2ecf20Sopenharmony_ci * RxChan: gain code, channel radio code, and phy type 13858c2ecf20Sopenharmony_ci */ 13868c2ecf20Sopenharmony_cistruct d11rxhdr_le { 13878c2ecf20Sopenharmony_ci __le16 RxFrameSize; 13888c2ecf20Sopenharmony_ci u16 PAD; 13898c2ecf20Sopenharmony_ci __le16 PhyRxStatus_0; 13908c2ecf20Sopenharmony_ci __le16 PhyRxStatus_1; 13918c2ecf20Sopenharmony_ci __le16 PhyRxStatus_2; 13928c2ecf20Sopenharmony_ci __le16 PhyRxStatus_3; 13938c2ecf20Sopenharmony_ci __le16 PhyRxStatus_4; 13948c2ecf20Sopenharmony_ci __le16 PhyRxStatus_5; 13958c2ecf20Sopenharmony_ci __le16 RxStatus1; 13968c2ecf20Sopenharmony_ci __le16 RxStatus2; 13978c2ecf20Sopenharmony_ci __le16 RxTSFTime; 13988c2ecf20Sopenharmony_ci __le16 RxChan; 13998c2ecf20Sopenharmony_ci} __packed; 14008c2ecf20Sopenharmony_ci 14018c2ecf20Sopenharmony_cistruct d11rxhdr { 14028c2ecf20Sopenharmony_ci u16 RxFrameSize; 14038c2ecf20Sopenharmony_ci u16 PAD; 14048c2ecf20Sopenharmony_ci u16 PhyRxStatus_0; 14058c2ecf20Sopenharmony_ci u16 PhyRxStatus_1; 14068c2ecf20Sopenharmony_ci u16 PhyRxStatus_2; 14078c2ecf20Sopenharmony_ci u16 PhyRxStatus_3; 14088c2ecf20Sopenharmony_ci u16 PhyRxStatus_4; 14098c2ecf20Sopenharmony_ci u16 PhyRxStatus_5; 14108c2ecf20Sopenharmony_ci u16 RxStatus1; 14118c2ecf20Sopenharmony_ci u16 RxStatus2; 14128c2ecf20Sopenharmony_ci u16 RxTSFTime; 14138c2ecf20Sopenharmony_ci u16 RxChan; 14148c2ecf20Sopenharmony_ci} __packed; 14158c2ecf20Sopenharmony_ci 14168c2ecf20Sopenharmony_ci/* PhyRxStatus_0: */ 14178c2ecf20Sopenharmony_ci/* NPHY only: CCK, OFDM, preN, N */ 14188c2ecf20Sopenharmony_ci#define PRXS0_FT_MASK 0x0003 14198c2ecf20Sopenharmony_ci/* NPHY only: clip count adjustment steps by AGC */ 14208c2ecf20Sopenharmony_ci#define PRXS0_CLIP_MASK 0x000C 14218c2ecf20Sopenharmony_ci#define PRXS0_CLIP_SHIFT 2 14228c2ecf20Sopenharmony_ci/* PHY received a frame with unsupported rate */ 14238c2ecf20Sopenharmony_ci#define PRXS0_UNSRATE 0x0010 14248c2ecf20Sopenharmony_ci/* GPHY: rx ant, NPHY: upper sideband */ 14258c2ecf20Sopenharmony_ci#define PRXS0_RXANT_UPSUBBAND 0x0020 14268c2ecf20Sopenharmony_ci/* CCK frame only: lost crs during cck frame reception */ 14278c2ecf20Sopenharmony_ci#define PRXS0_LCRS 0x0040 14288c2ecf20Sopenharmony_ci/* Short Preamble */ 14298c2ecf20Sopenharmony_ci#define PRXS0_SHORTH 0x0080 14308c2ecf20Sopenharmony_ci/* PLCP violation */ 14318c2ecf20Sopenharmony_ci#define PRXS0_PLCPFV 0x0100 14328c2ecf20Sopenharmony_ci/* PLCP header integrity check failed */ 14338c2ecf20Sopenharmony_ci#define PRXS0_PLCPHCF 0x0200 14348c2ecf20Sopenharmony_ci/* legacy PHY gain control */ 14358c2ecf20Sopenharmony_ci#define PRXS0_GAIN_CTL 0x4000 14368c2ecf20Sopenharmony_ci/* NPHY: Antennas used for received frame, bitmask */ 14378c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_MASK 0xF000 14388c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_SHIFT 0x12 14398c2ecf20Sopenharmony_ci 14408c2ecf20Sopenharmony_ci/* subfield PRXS0_FT_MASK */ 14418c2ecf20Sopenharmony_ci#define PRXS0_CCK 0x0000 14428c2ecf20Sopenharmony_ci/* valid only for G phy, use rxh->RxChan for A phy */ 14438c2ecf20Sopenharmony_ci#define PRXS0_OFDM 0x0001 14448c2ecf20Sopenharmony_ci#define PRXS0_PREN 0x0002 14458c2ecf20Sopenharmony_ci#define PRXS0_STDN 0x0003 14468c2ecf20Sopenharmony_ci 14478c2ecf20Sopenharmony_ci/* subfield PRXS0_ANTSEL_MASK */ 14488c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_0 0x0 /* antenna 0 is used */ 14498c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_1 0x2 /* antenna 1 is used */ 14508c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_2 0x4 /* antenna 2 is used */ 14518c2ecf20Sopenharmony_ci#define PRXS0_ANTSEL_3 0x8 /* antenna 3 is used */ 14528c2ecf20Sopenharmony_ci 14538c2ecf20Sopenharmony_ci/* PhyRxStatus_1: */ 14548c2ecf20Sopenharmony_ci#define PRXS1_JSSI_MASK 0x00FF 14558c2ecf20Sopenharmony_ci#define PRXS1_JSSI_SHIFT 0 14568c2ecf20Sopenharmony_ci#define PRXS1_SQ_MASK 0xFF00 14578c2ecf20Sopenharmony_ci#define PRXS1_SQ_SHIFT 8 14588c2ecf20Sopenharmony_ci 14598c2ecf20Sopenharmony_ci/* nphy PhyRxStatus_1: */ 14608c2ecf20Sopenharmony_ci#define PRXS1_nphy_PWR0_MASK 0x00FF 14618c2ecf20Sopenharmony_ci#define PRXS1_nphy_PWR1_MASK 0xFF00 14628c2ecf20Sopenharmony_ci 14638c2ecf20Sopenharmony_ci/* HTPHY Rx Status defines */ 14648c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_0: those bit are overlapped with PhyRxStatus_0 */ 14658c2ecf20Sopenharmony_ci#define PRXS0_BAND 0x0400 /* 0 = 2.4G, 1 = 5G */ 14668c2ecf20Sopenharmony_ci#define PRXS0_RSVD 0x0800 /* reserved; set to 0 */ 14678c2ecf20Sopenharmony_ci#define PRXS0_UNUSED 0xF000 /* unused and not defined; set to 0 */ 14688c2ecf20Sopenharmony_ci 14698c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_1: */ 14708c2ecf20Sopenharmony_ci/* core enables for {3..0}, 0=disabled, 1=enabled */ 14718c2ecf20Sopenharmony_ci#define PRXS1_HTPHY_CORE_MASK 0x000F 14728c2ecf20Sopenharmony_ci/* antenna configation */ 14738c2ecf20Sopenharmony_ci#define PRXS1_HTPHY_ANTCFG_MASK 0x00F0 14748c2ecf20Sopenharmony_ci/* Mixmode PLCP Length low byte mask */ 14758c2ecf20Sopenharmony_ci#define PRXS1_HTPHY_MMPLCPLenL_MASK 0xFF00 14768c2ecf20Sopenharmony_ci 14778c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_2: */ 14788c2ecf20Sopenharmony_ci/* Mixmode PLCP Length high byte maskw */ 14798c2ecf20Sopenharmony_ci#define PRXS2_HTPHY_MMPLCPLenH_MASK 0x000F 14808c2ecf20Sopenharmony_ci/* Mixmode PLCP rate mask */ 14818c2ecf20Sopenharmony_ci#define PRXS2_HTPHY_MMPLCH_RATE_MASK 0x00F0 14828c2ecf20Sopenharmony_ci/* Rx power on core 0 */ 14838c2ecf20Sopenharmony_ci#define PRXS2_HTPHY_RXPWR_ANT0 0xFF00 14848c2ecf20Sopenharmony_ci 14858c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_3: */ 14868c2ecf20Sopenharmony_ci/* Rx power on core 1 */ 14878c2ecf20Sopenharmony_ci#define PRXS3_HTPHY_RXPWR_ANT1 0x00FF 14888c2ecf20Sopenharmony_ci/* Rx power on core 2 */ 14898c2ecf20Sopenharmony_ci#define PRXS3_HTPHY_RXPWR_ANT2 0xFF00 14908c2ecf20Sopenharmony_ci 14918c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_4: */ 14928c2ecf20Sopenharmony_ci/* Rx power on core 3 */ 14938c2ecf20Sopenharmony_ci#define PRXS4_HTPHY_RXPWR_ANT3 0x00FF 14948c2ecf20Sopenharmony_ci/* Coarse frequency offset */ 14958c2ecf20Sopenharmony_ci#define PRXS4_HTPHY_CFO 0xFF00 14968c2ecf20Sopenharmony_ci 14978c2ecf20Sopenharmony_ci/* htphy PhyRxStatus_5: */ 14988c2ecf20Sopenharmony_ci/* Fine frequency offset */ 14998c2ecf20Sopenharmony_ci#define PRXS5_HTPHY_FFO 0x00FF 15008c2ecf20Sopenharmony_ci/* Advance Retard */ 15018c2ecf20Sopenharmony_ci#define PRXS5_HTPHY_AR 0xFF00 15028c2ecf20Sopenharmony_ci 15038c2ecf20Sopenharmony_ci#define HTPHY_MMPLCPLen(rxs) \ 15048c2ecf20Sopenharmony_ci ((((rxs)->PhyRxStatus_1 & PRXS1_HTPHY_MMPLCPLenL_MASK) >> 8) | \ 15058c2ecf20Sopenharmony_ci (((rxs)->PhyRxStatus_2 & PRXS2_HTPHY_MMPLCPLenH_MASK) << 8)) 15068c2ecf20Sopenharmony_ci/* Get Rx power on core 0 */ 15078c2ecf20Sopenharmony_ci#define HTPHY_RXPWR_ANT0(rxs) \ 15088c2ecf20Sopenharmony_ci ((((rxs)->PhyRxStatus_2) & PRXS2_HTPHY_RXPWR_ANT0) >> 8) 15098c2ecf20Sopenharmony_ci/* Get Rx power on core 1 */ 15108c2ecf20Sopenharmony_ci#define HTPHY_RXPWR_ANT1(rxs) \ 15118c2ecf20Sopenharmony_ci (((rxs)->PhyRxStatus_3) & PRXS3_HTPHY_RXPWR_ANT1) 15128c2ecf20Sopenharmony_ci/* Get Rx power on core 2 */ 15138c2ecf20Sopenharmony_ci#define HTPHY_RXPWR_ANT2(rxs) \ 15148c2ecf20Sopenharmony_ci ((((rxs)->PhyRxStatus_3) & PRXS3_HTPHY_RXPWR_ANT2) >> 8) 15158c2ecf20Sopenharmony_ci 15168c2ecf20Sopenharmony_ci/* ucode RxStatus1: */ 15178c2ecf20Sopenharmony_ci#define RXS_BCNSENT 0x8000 15188c2ecf20Sopenharmony_ci#define RXS_SECKINDX_MASK 0x07e0 15198c2ecf20Sopenharmony_ci#define RXS_SECKINDX_SHIFT 5 15208c2ecf20Sopenharmony_ci#define RXS_DECERR (1 << 4) 15218c2ecf20Sopenharmony_ci#define RXS_DECATMPT (1 << 3) 15228c2ecf20Sopenharmony_ci/* PAD bytes to make IP data 4 bytes aligned */ 15238c2ecf20Sopenharmony_ci#define RXS_PBPRES (1 << 2) 15248c2ecf20Sopenharmony_ci#define RXS_RESPFRAMETX (1 << 1) 15258c2ecf20Sopenharmony_ci#define RXS_FCSERR (1 << 0) 15268c2ecf20Sopenharmony_ci 15278c2ecf20Sopenharmony_ci/* ucode RxStatus2: */ 15288c2ecf20Sopenharmony_ci#define RXS_AMSDU_MASK 1 15298c2ecf20Sopenharmony_ci#define RXS_AGGTYPE_MASK 0x6 15308c2ecf20Sopenharmony_ci#define RXS_AGGTYPE_SHIFT 1 15318c2ecf20Sopenharmony_ci#define RXS_PHYRXST_VALID (1 << 8) 15328c2ecf20Sopenharmony_ci#define RXS_RXANT_MASK 0x3 15338c2ecf20Sopenharmony_ci#define RXS_RXANT_SHIFT 12 15348c2ecf20Sopenharmony_ci 15358c2ecf20Sopenharmony_ci/* RxChan */ 15368c2ecf20Sopenharmony_ci#define RXS_CHAN_40 0x1000 15378c2ecf20Sopenharmony_ci#define RXS_CHAN_5G 0x0800 15388c2ecf20Sopenharmony_ci#define RXS_CHAN_ID_MASK 0x07f8 15398c2ecf20Sopenharmony_ci#define RXS_CHAN_ID_SHIFT 3 15408c2ecf20Sopenharmony_ci#define RXS_CHAN_PHYTYPE_MASK 0x0007 15418c2ecf20Sopenharmony_ci#define RXS_CHAN_PHYTYPE_SHIFT 0 15428c2ecf20Sopenharmony_ci 15438c2ecf20Sopenharmony_ci/* Index of attenuations used during ucode power control. */ 15448c2ecf20Sopenharmony_ci#define M_PWRIND_BLKS (0x184 * 2) 15458c2ecf20Sopenharmony_ci#define M_PWRIND_MAP0 (M_PWRIND_BLKS + 0x0) 15468c2ecf20Sopenharmony_ci#define M_PWRIND_MAP1 (M_PWRIND_BLKS + 0x2) 15478c2ecf20Sopenharmony_ci#define M_PWRIND_MAP2 (M_PWRIND_BLKS + 0x4) 15488c2ecf20Sopenharmony_ci#define M_PWRIND_MAP3 (M_PWRIND_BLKS + 0x6) 15498c2ecf20Sopenharmony_ci/* M_PWRIND_MAP(core) macro */ 15508c2ecf20Sopenharmony_ci#define M_PWRIND_MAP(core) (M_PWRIND_BLKS + ((core)<<1)) 15518c2ecf20Sopenharmony_ci 15528c2ecf20Sopenharmony_ci/* PSM SHM variable offsets */ 15538c2ecf20Sopenharmony_ci#define M_PSM_SOFT_REGS 0x0 15548c2ecf20Sopenharmony_ci#define M_BOM_REV_MAJOR (M_PSM_SOFT_REGS + 0x0) 15558c2ecf20Sopenharmony_ci#define M_BOM_REV_MINOR (M_PSM_SOFT_REGS + 0x2) 15568c2ecf20Sopenharmony_ci#define M_UCODE_DBGST (M_PSM_SOFT_REGS + 0x40) /* ucode debug status code */ 15578c2ecf20Sopenharmony_ci#define M_UCODE_MACSTAT (M_PSM_SOFT_REGS + 0xE0) /* macstat counters */ 15588c2ecf20Sopenharmony_ci 15598c2ecf20Sopenharmony_ci#define M_AGING_THRSH (0x3e * 2) /* max time waiting for medium before tx */ 15608c2ecf20Sopenharmony_ci#define M_MBURST_SIZE (0x40 * 2) /* max frames in a frameburst */ 15618c2ecf20Sopenharmony_ci#define M_MBURST_TXOP (0x41 * 2) /* max frameburst TXOP in unit of us */ 15628c2ecf20Sopenharmony_ci#define M_SYNTHPU_DLY (0x4a * 2) /* pre-wakeup for synthpu, default: 500 */ 15638c2ecf20Sopenharmony_ci#define M_PRETBTT (0x4b * 2) 15648c2ecf20Sopenharmony_ci 15658c2ecf20Sopenharmony_ci/* offset to the target txpwr */ 15668c2ecf20Sopenharmony_ci#define M_ALT_TXPWR_IDX (M_PSM_SOFT_REGS + (0x3b * 2)) 15678c2ecf20Sopenharmony_ci#define M_PHY_TX_FLT_PTR (M_PSM_SOFT_REGS + (0x3d * 2)) 15688c2ecf20Sopenharmony_ci#define M_CTS_DURATION (M_PSM_SOFT_REGS + (0x5c * 2)) 15698c2ecf20Sopenharmony_ci#define M_LP_RCCAL_OVR (M_PSM_SOFT_REGS + (0x6b * 2)) 15708c2ecf20Sopenharmony_ci 15718c2ecf20Sopenharmony_ci/* PKTENG Rx Stats Block */ 15728c2ecf20Sopenharmony_ci#define M_RXSTATS_BLK_PTR (M_PSM_SOFT_REGS + (0x65 * 2)) 15738c2ecf20Sopenharmony_ci 15748c2ecf20Sopenharmony_ci/* ucode debug status codes */ 15758c2ecf20Sopenharmony_ci/* not valid really */ 15768c2ecf20Sopenharmony_ci#define DBGST_INACTIVE 0 15778c2ecf20Sopenharmony_ci/* after zeroing SHM, before suspending at init */ 15788c2ecf20Sopenharmony_ci#define DBGST_INIT 1 15798c2ecf20Sopenharmony_ci/* "normal" state */ 15808c2ecf20Sopenharmony_ci#define DBGST_ACTIVE 2 15818c2ecf20Sopenharmony_ci/* suspended */ 15828c2ecf20Sopenharmony_ci#define DBGST_SUSPENDED 3 15838c2ecf20Sopenharmony_ci/* asleep (PS mode) */ 15848c2ecf20Sopenharmony_ci#define DBGST_ASLEEP 4 15858c2ecf20Sopenharmony_ci 15868c2ecf20Sopenharmony_ci/* Scratch Reg defs */ 15878c2ecf20Sopenharmony_cienum _ePsmScratchPadRegDefinitions { 15888c2ecf20Sopenharmony_ci S_RSV0 = 0, 15898c2ecf20Sopenharmony_ci S_RSV1, 15908c2ecf20Sopenharmony_ci S_RSV2, 15918c2ecf20Sopenharmony_ci 15928c2ecf20Sopenharmony_ci /* offset 0x03: scratch registers for Dot11-contants */ 15938c2ecf20Sopenharmony_ci S_DOT11_CWMIN, /* CW-minimum */ 15948c2ecf20Sopenharmony_ci S_DOT11_CWMAX, /* CW-maximum */ 15958c2ecf20Sopenharmony_ci S_DOT11_CWCUR, /* CW-current */ 15968c2ecf20Sopenharmony_ci S_DOT11_SRC_LMT, /* short retry count limit */ 15978c2ecf20Sopenharmony_ci S_DOT11_LRC_LMT, /* long retry count limit */ 15988c2ecf20Sopenharmony_ci S_DOT11_DTIMCOUNT, /* DTIM-count */ 15998c2ecf20Sopenharmony_ci 16008c2ecf20Sopenharmony_ci /* offset 0x09: Tx-side scratch registers */ 16018c2ecf20Sopenharmony_ci S_SEQ_NUM, /* hardware sequence number reg */ 16028c2ecf20Sopenharmony_ci S_SEQ_NUM_FRAG, /* seq num for frags (at the start of MSDU) */ 16038c2ecf20Sopenharmony_ci S_FRMRETX_CNT, /* frame retx count */ 16048c2ecf20Sopenharmony_ci S_SSRC, /* Station short retry count */ 16058c2ecf20Sopenharmony_ci S_SLRC, /* Station long retry count */ 16068c2ecf20Sopenharmony_ci S_EXP_RSP, /* Expected response frame */ 16078c2ecf20Sopenharmony_ci S_OLD_BREM, /* Remaining backoff ctr */ 16088c2ecf20Sopenharmony_ci S_OLD_CWWIN, /* saved-off CW-cur */ 16098c2ecf20Sopenharmony_ci S_TXECTL, /* TXE-Ctl word constructed in scr-pad */ 16108c2ecf20Sopenharmony_ci S_CTXTST, /* frm type-subtype as read from Tx-descr */ 16118c2ecf20Sopenharmony_ci 16128c2ecf20Sopenharmony_ci /* offset 0x13: Rx-side scratch registers */ 16138c2ecf20Sopenharmony_ci S_RXTST, /* Type and subtype in Rxframe */ 16148c2ecf20Sopenharmony_ci 16158c2ecf20Sopenharmony_ci /* Global state register */ 16168c2ecf20Sopenharmony_ci S_STREG, /* state storage actual bit maps below */ 16178c2ecf20Sopenharmony_ci 16188c2ecf20Sopenharmony_ci S_TXPWR_SUM, /* Tx power control: accumulator */ 16198c2ecf20Sopenharmony_ci S_TXPWR_ITER, /* Tx power control: iteration */ 16208c2ecf20Sopenharmony_ci S_RX_FRMTYPE, /* Rate and PHY type for frames */ 16218c2ecf20Sopenharmony_ci S_THIS_AGG, /* Size of this AGG (A-MSDU) */ 16228c2ecf20Sopenharmony_ci 16238c2ecf20Sopenharmony_ci S_KEYINDX, 16248c2ecf20Sopenharmony_ci S_RXFRMLEN, /* Receive MPDU length in bytes */ 16258c2ecf20Sopenharmony_ci 16268c2ecf20Sopenharmony_ci /* offset 0x1B: Receive TSF time stored in SCR */ 16278c2ecf20Sopenharmony_ci S_RXTSFTMRVAL_WD3, /* TSF value at the start of rx */ 16288c2ecf20Sopenharmony_ci S_RXTSFTMRVAL_WD2, /* TSF value at the start of rx */ 16298c2ecf20Sopenharmony_ci S_RXTSFTMRVAL_WD1, /* TSF value at the start of rx */ 16308c2ecf20Sopenharmony_ci S_RXTSFTMRVAL_WD0, /* TSF value at the start of rx */ 16318c2ecf20Sopenharmony_ci S_RXSSN, /* Received start seq number for A-MPDU BA */ 16328c2ecf20Sopenharmony_ci S_RXQOSFLD, /* Rx-QoS field (if present) */ 16338c2ecf20Sopenharmony_ci 16348c2ecf20Sopenharmony_ci /* offset 0x21: Scratch pad regs used in microcode as temp storage */ 16358c2ecf20Sopenharmony_ci S_TMP0, /* stmp0 */ 16368c2ecf20Sopenharmony_ci S_TMP1, /* stmp1 */ 16378c2ecf20Sopenharmony_ci S_TMP2, /* stmp2 */ 16388c2ecf20Sopenharmony_ci S_TMP3, /* stmp3 */ 16398c2ecf20Sopenharmony_ci S_TMP4, /* stmp4 */ 16408c2ecf20Sopenharmony_ci S_TMP5, /* stmp5 */ 16418c2ecf20Sopenharmony_ci S_PRQPENALTY_CTR, /* Probe response queue penalty counter */ 16428c2ecf20Sopenharmony_ci S_ANTCNT, /* unsuccessful attempts on current ant. */ 16438c2ecf20Sopenharmony_ci S_SYMBOL, /* flag for possible symbol ctl frames */ 16448c2ecf20Sopenharmony_ci S_RXTP, /* rx frame type */ 16458c2ecf20Sopenharmony_ci S_STREG2, /* extra state storage */ 16468c2ecf20Sopenharmony_ci S_STREG3, /* even more extra state storage */ 16478c2ecf20Sopenharmony_ci S_STREG4, /* ... */ 16488c2ecf20Sopenharmony_ci S_STREG5, /* remember to initialize it to zero */ 16498c2ecf20Sopenharmony_ci 16508c2ecf20Sopenharmony_ci S_ADJPWR_IDX, 16518c2ecf20Sopenharmony_ci S_CUR_PTR, /* Temp pointer for A-MPDU re-Tx SHM table */ 16528c2ecf20Sopenharmony_ci S_REVID4, /* 0x33 */ 16538c2ecf20Sopenharmony_ci S_INDX, /* 0x34 */ 16548c2ecf20Sopenharmony_ci S_ADDR0, /* 0x35 */ 16558c2ecf20Sopenharmony_ci S_ADDR1, /* 0x36 */ 16568c2ecf20Sopenharmony_ci S_ADDR2, /* 0x37 */ 16578c2ecf20Sopenharmony_ci S_ADDR3, /* 0x38 */ 16588c2ecf20Sopenharmony_ci S_ADDR4, /* 0x39 */ 16598c2ecf20Sopenharmony_ci S_ADDR5, /* 0x3A */ 16608c2ecf20Sopenharmony_ci S_TMP6, /* 0x3B */ 16618c2ecf20Sopenharmony_ci S_KEYINDX_BU, /* Backup for Key index */ 16628c2ecf20Sopenharmony_ci S_MFGTEST_TMP0, /* Temp regs used for RX test calculations */ 16638c2ecf20Sopenharmony_ci S_RXESN, /* Received end sequence number for A-MPDU BA */ 16648c2ecf20Sopenharmony_ci S_STREG6, /* 0x3F */ 16658c2ecf20Sopenharmony_ci}; 16668c2ecf20Sopenharmony_ci 16678c2ecf20Sopenharmony_ci#define S_BEACON_INDX S_OLD_BREM 16688c2ecf20Sopenharmony_ci#define S_PRS_INDX S_OLD_CWWIN 16698c2ecf20Sopenharmony_ci#define S_PHYTYPE S_SSRC 16708c2ecf20Sopenharmony_ci#define S_PHYVER S_SLRC 16718c2ecf20Sopenharmony_ci 16728c2ecf20Sopenharmony_ci/* IHR SLOW_CTRL values */ 16738c2ecf20Sopenharmony_ci#define SLOW_CTRL_PDE (1 << 0) 16748c2ecf20Sopenharmony_ci#define SLOW_CTRL_FD (1 << 8) 16758c2ecf20Sopenharmony_ci 16768c2ecf20Sopenharmony_ci/* ucode mac statistic counters in shared memory */ 16778c2ecf20Sopenharmony_cistruct macstat { 16788c2ecf20Sopenharmony_ci u16 txallfrm; /* 0x80 */ 16798c2ecf20Sopenharmony_ci u16 txrtsfrm; /* 0x82 */ 16808c2ecf20Sopenharmony_ci u16 txctsfrm; /* 0x84 */ 16818c2ecf20Sopenharmony_ci u16 txackfrm; /* 0x86 */ 16828c2ecf20Sopenharmony_ci u16 txdnlfrm; /* 0x88 */ 16838c2ecf20Sopenharmony_ci u16 txbcnfrm; /* 0x8a */ 16848c2ecf20Sopenharmony_ci u16 txfunfl[8]; /* 0x8c - 0x9b */ 16858c2ecf20Sopenharmony_ci u16 txtplunfl; /* 0x9c */ 16868c2ecf20Sopenharmony_ci u16 txphyerr; /* 0x9e */ 16878c2ecf20Sopenharmony_ci u16 pktengrxducast; /* 0xa0 */ 16888c2ecf20Sopenharmony_ci u16 pktengrxdmcast; /* 0xa2 */ 16898c2ecf20Sopenharmony_ci u16 rxfrmtoolong; /* 0xa4 */ 16908c2ecf20Sopenharmony_ci u16 rxfrmtooshrt; /* 0xa6 */ 16918c2ecf20Sopenharmony_ci u16 rxinvmachdr; /* 0xa8 */ 16928c2ecf20Sopenharmony_ci u16 rxbadfcs; /* 0xaa */ 16938c2ecf20Sopenharmony_ci u16 rxbadplcp; /* 0xac */ 16948c2ecf20Sopenharmony_ci u16 rxcrsglitch; /* 0xae */ 16958c2ecf20Sopenharmony_ci u16 rxstrt; /* 0xb0 */ 16968c2ecf20Sopenharmony_ci u16 rxdfrmucastmbss; /* 0xb2 */ 16978c2ecf20Sopenharmony_ci u16 rxmfrmucastmbss; /* 0xb4 */ 16988c2ecf20Sopenharmony_ci u16 rxcfrmucast; /* 0xb6 */ 16998c2ecf20Sopenharmony_ci u16 rxrtsucast; /* 0xb8 */ 17008c2ecf20Sopenharmony_ci u16 rxctsucast; /* 0xba */ 17018c2ecf20Sopenharmony_ci u16 rxackucast; /* 0xbc */ 17028c2ecf20Sopenharmony_ci u16 rxdfrmocast; /* 0xbe */ 17038c2ecf20Sopenharmony_ci u16 rxmfrmocast; /* 0xc0 */ 17048c2ecf20Sopenharmony_ci u16 rxcfrmocast; /* 0xc2 */ 17058c2ecf20Sopenharmony_ci u16 rxrtsocast; /* 0xc4 */ 17068c2ecf20Sopenharmony_ci u16 rxctsocast; /* 0xc6 */ 17078c2ecf20Sopenharmony_ci u16 rxdfrmmcast; /* 0xc8 */ 17088c2ecf20Sopenharmony_ci u16 rxmfrmmcast; /* 0xca */ 17098c2ecf20Sopenharmony_ci u16 rxcfrmmcast; /* 0xcc */ 17108c2ecf20Sopenharmony_ci u16 rxbeaconmbss; /* 0xce */ 17118c2ecf20Sopenharmony_ci u16 rxdfrmucastobss; /* 0xd0 */ 17128c2ecf20Sopenharmony_ci u16 rxbeaconobss; /* 0xd2 */ 17138c2ecf20Sopenharmony_ci u16 rxrsptmout; /* 0xd4 */ 17148c2ecf20Sopenharmony_ci u16 bcntxcancl; /* 0xd6 */ 17158c2ecf20Sopenharmony_ci u16 PAD; 17168c2ecf20Sopenharmony_ci u16 rxf0ovfl; /* 0xda */ 17178c2ecf20Sopenharmony_ci u16 rxf1ovfl; /* 0xdc */ 17188c2ecf20Sopenharmony_ci u16 rxf2ovfl; /* 0xde */ 17198c2ecf20Sopenharmony_ci u16 txsfovfl; /* 0xe0 */ 17208c2ecf20Sopenharmony_ci u16 pmqovfl; /* 0xe2 */ 17218c2ecf20Sopenharmony_ci u16 rxcgprqfrm; /* 0xe4 */ 17228c2ecf20Sopenharmony_ci u16 rxcgprsqovfl; /* 0xe6 */ 17238c2ecf20Sopenharmony_ci u16 txcgprsfail; /* 0xe8 */ 17248c2ecf20Sopenharmony_ci u16 txcgprssuc; /* 0xea */ 17258c2ecf20Sopenharmony_ci u16 prs_timeout; /* 0xec */ 17268c2ecf20Sopenharmony_ci u16 rxnack; 17278c2ecf20Sopenharmony_ci u16 frmscons; 17288c2ecf20Sopenharmony_ci u16 txnack; 17298c2ecf20Sopenharmony_ci u16 txglitch_nack; 17308c2ecf20Sopenharmony_ci u16 txburst; /* 0xf6 # tx bursts */ 17318c2ecf20Sopenharmony_ci u16 bphy_rxcrsglitch; /* bphy rx crs glitch */ 17328c2ecf20Sopenharmony_ci u16 phywatchdog; /* 0xfa # of phy watchdog events */ 17338c2ecf20Sopenharmony_ci u16 PAD; 17348c2ecf20Sopenharmony_ci u16 bphy_badplcp; /* bphy bad plcp */ 17358c2ecf20Sopenharmony_ci}; 17368c2ecf20Sopenharmony_ci 17378c2ecf20Sopenharmony_ci/* dot11 core-specific control flags */ 17388c2ecf20Sopenharmony_ci#define SICF_PCLKE 0x0004 /* PHY clock enable */ 17398c2ecf20Sopenharmony_ci#define SICF_PRST 0x0008 /* PHY reset */ 17408c2ecf20Sopenharmony_ci#define SICF_MPCLKE 0x0010 /* MAC PHY clockcontrol enable */ 17418c2ecf20Sopenharmony_ci#define SICF_FREF 0x0020 /* PLL FreqRefSelect */ 17428c2ecf20Sopenharmony_ci/* NOTE: the following bw bits only apply when the core is attached 17438c2ecf20Sopenharmony_ci * to a NPHY 17448c2ecf20Sopenharmony_ci */ 17458c2ecf20Sopenharmony_ci#define SICF_BWMASK 0x00c0 /* phy clock mask (b6 & b7) */ 17468c2ecf20Sopenharmony_ci#define SICF_BW40 0x0080 /* 40MHz BW (160MHz phyclk) */ 17478c2ecf20Sopenharmony_ci#define SICF_BW20 0x0040 /* 20MHz BW (80MHz phyclk) */ 17488c2ecf20Sopenharmony_ci#define SICF_BW10 0x0000 /* 10MHz BW (40MHz phyclk) */ 17498c2ecf20Sopenharmony_ci#define SICF_GMODE 0x2000 /* gmode enable */ 17508c2ecf20Sopenharmony_ci 17518c2ecf20Sopenharmony_ci/* dot11 core-specific status flags */ 17528c2ecf20Sopenharmony_ci#define SISF_2G_PHY 0x0001 /* 2.4G capable phy */ 17538c2ecf20Sopenharmony_ci#define SISF_5G_PHY 0x0002 /* 5G capable phy */ 17548c2ecf20Sopenharmony_ci#define SISF_FCLKA 0x0004 /* FastClkAvailable */ 17558c2ecf20Sopenharmony_ci#define SISF_DB_PHY 0x0008 /* Dualband phy */ 17568c2ecf20Sopenharmony_ci 17578c2ecf20Sopenharmony_ci/* === End of MAC reg, Beginning of PHY(b/a/g/n) reg === */ 17588c2ecf20Sopenharmony_ci/* radio and LPPHY regs are separated */ 17598c2ecf20Sopenharmony_ci 17608c2ecf20Sopenharmony_ci#define BPHY_REG_OFT_BASE 0x0 17618c2ecf20Sopenharmony_ci/* offsets for indirect access to bphy registers */ 17628c2ecf20Sopenharmony_ci#define BPHY_BB_CONFIG 0x01 17638c2ecf20Sopenharmony_ci#define BPHY_ADCBIAS 0x02 17648c2ecf20Sopenharmony_ci#define BPHY_ANACORE 0x03 17658c2ecf20Sopenharmony_ci#define BPHY_PHYCRSTH 0x06 17668c2ecf20Sopenharmony_ci#define BPHY_TEST 0x0a 17678c2ecf20Sopenharmony_ci#define BPHY_PA_TX_TO 0x10 17688c2ecf20Sopenharmony_ci#define BPHY_SYNTH_DC_TO 0x11 17698c2ecf20Sopenharmony_ci#define BPHY_PA_TX_TIME_UP 0x12 17708c2ecf20Sopenharmony_ci#define BPHY_RX_FLTR_TIME_UP 0x13 17718c2ecf20Sopenharmony_ci#define BPHY_TX_POWER_OVERRIDE 0x14 17728c2ecf20Sopenharmony_ci#define BPHY_RF_OVERRIDE 0x15 17738c2ecf20Sopenharmony_ci#define BPHY_RF_TR_LOOKUP1 0x16 17748c2ecf20Sopenharmony_ci#define BPHY_RF_TR_LOOKUP2 0x17 17758c2ecf20Sopenharmony_ci#define BPHY_COEFFS 0x18 17768c2ecf20Sopenharmony_ci#define BPHY_PLL_OUT 0x19 17778c2ecf20Sopenharmony_ci#define BPHY_REFRESH_MAIN 0x1a 17788c2ecf20Sopenharmony_ci#define BPHY_REFRESH_TO0 0x1b 17798c2ecf20Sopenharmony_ci#define BPHY_REFRESH_TO1 0x1c 17808c2ecf20Sopenharmony_ci#define BPHY_RSSI_TRESH 0x20 17818c2ecf20Sopenharmony_ci#define BPHY_IQ_TRESH_HH 0x21 17828c2ecf20Sopenharmony_ci#define BPHY_IQ_TRESH_H 0x22 17838c2ecf20Sopenharmony_ci#define BPHY_IQ_TRESH_L 0x23 17848c2ecf20Sopenharmony_ci#define BPHY_IQ_TRESH_LL 0x24 17858c2ecf20Sopenharmony_ci#define BPHY_GAIN 0x25 17868c2ecf20Sopenharmony_ci#define BPHY_LNA_GAIN_RANGE 0x26 17878c2ecf20Sopenharmony_ci#define BPHY_JSSI 0x27 17888c2ecf20Sopenharmony_ci#define BPHY_TSSI_CTL 0x28 17898c2ecf20Sopenharmony_ci#define BPHY_TSSI 0x29 17908c2ecf20Sopenharmony_ci#define BPHY_TR_LOSS_CTL 0x2a 17918c2ecf20Sopenharmony_ci#define BPHY_LO_LEAKAGE 0x2b 17928c2ecf20Sopenharmony_ci#define BPHY_LO_RSSI_ACC 0x2c 17938c2ecf20Sopenharmony_ci#define BPHY_LO_IQMAG_ACC 0x2d 17948c2ecf20Sopenharmony_ci#define BPHY_TX_DC_OFF1 0x2e 17958c2ecf20Sopenharmony_ci#define BPHY_TX_DC_OFF2 0x2f 17968c2ecf20Sopenharmony_ci#define BPHY_PEAK_CNT_THRESH 0x30 17978c2ecf20Sopenharmony_ci#define BPHY_FREQ_OFFSET 0x31 17988c2ecf20Sopenharmony_ci#define BPHY_DIVERSITY_CTL 0x32 17998c2ecf20Sopenharmony_ci#define BPHY_PEAK_ENERGY_LO 0x33 18008c2ecf20Sopenharmony_ci#define BPHY_PEAK_ENERGY_HI 0x34 18018c2ecf20Sopenharmony_ci#define BPHY_SYNC_CTL 0x35 18028c2ecf20Sopenharmony_ci#define BPHY_TX_PWR_CTRL 0x36 18038c2ecf20Sopenharmony_ci#define BPHY_TX_EST_PWR 0x37 18048c2ecf20Sopenharmony_ci#define BPHY_STEP 0x38 18058c2ecf20Sopenharmony_ci#define BPHY_WARMUP 0x39 18068c2ecf20Sopenharmony_ci#define BPHY_LMS_CFF_READ 0x3a 18078c2ecf20Sopenharmony_ci#define BPHY_LMS_COEFF_I 0x3b 18088c2ecf20Sopenharmony_ci#define BPHY_LMS_COEFF_Q 0x3c 18098c2ecf20Sopenharmony_ci#define BPHY_SIG_POW 0x3d 18108c2ecf20Sopenharmony_ci#define BPHY_RFDC_CANCEL_CTL 0x3e 18118c2ecf20Sopenharmony_ci#define BPHY_HDR_TYPE 0x40 18128c2ecf20Sopenharmony_ci#define BPHY_SFD_TO 0x41 18138c2ecf20Sopenharmony_ci#define BPHY_SFD_CTL 0x42 18148c2ecf20Sopenharmony_ci#define BPHY_DEBUG 0x43 18158c2ecf20Sopenharmony_ci#define BPHY_RX_DELAY_COMP 0x44 18168c2ecf20Sopenharmony_ci#define BPHY_CRS_DROP_TO 0x45 18178c2ecf20Sopenharmony_ci#define BPHY_SHORT_SFD_NZEROS 0x46 18188c2ecf20Sopenharmony_ci#define BPHY_DSSS_COEFF1 0x48 18198c2ecf20Sopenharmony_ci#define BPHY_DSSS_COEFF2 0x49 18208c2ecf20Sopenharmony_ci#define BPHY_CCK_COEFF1 0x4a 18218c2ecf20Sopenharmony_ci#define BPHY_CCK_COEFF2 0x4b 18228c2ecf20Sopenharmony_ci#define BPHY_TR_CORR 0x4c 18238c2ecf20Sopenharmony_ci#define BPHY_ANGLE_SCALE 0x4d 18248c2ecf20Sopenharmony_ci#define BPHY_TX_PWR_BASE_IDX 0x4e 18258c2ecf20Sopenharmony_ci#define BPHY_OPTIONAL_MODES2 0x4f 18268c2ecf20Sopenharmony_ci#define BPHY_CCK_LMS_STEP 0x50 18278c2ecf20Sopenharmony_ci#define BPHY_BYPASS 0x51 18288c2ecf20Sopenharmony_ci#define BPHY_CCK_DELAY_LONG 0x52 18298c2ecf20Sopenharmony_ci#define BPHY_CCK_DELAY_SHORT 0x53 18308c2ecf20Sopenharmony_ci#define BPHY_PPROC_CHAN_DELAY 0x54 18318c2ecf20Sopenharmony_ci#define BPHY_DDFS_ENABLE 0x58 18328c2ecf20Sopenharmony_ci#define BPHY_PHASE_SCALE 0x59 18338c2ecf20Sopenharmony_ci#define BPHY_FREQ_CONTROL 0x5a 18348c2ecf20Sopenharmony_ci#define BPHY_LNA_GAIN_RANGE_10 0x5b 18358c2ecf20Sopenharmony_ci#define BPHY_LNA_GAIN_RANGE_32 0x5c 18368c2ecf20Sopenharmony_ci#define BPHY_OPTIONAL_MODES 0x5d 18378c2ecf20Sopenharmony_ci#define BPHY_RX_STATUS2 0x5e 18388c2ecf20Sopenharmony_ci#define BPHY_RX_STATUS3 0x5f 18398c2ecf20Sopenharmony_ci#define BPHY_DAC_CONTROL 0x60 18408c2ecf20Sopenharmony_ci#define BPHY_ANA11G_FILT_CTRL 0x62 18418c2ecf20Sopenharmony_ci#define BPHY_REFRESH_CTRL 0x64 18428c2ecf20Sopenharmony_ci#define BPHY_RF_OVERRIDE2 0x65 18438c2ecf20Sopenharmony_ci#define BPHY_SPUR_CANCEL_CTRL 0x66 18448c2ecf20Sopenharmony_ci#define BPHY_FINE_DIGIGAIN_CTRL 0x67 18458c2ecf20Sopenharmony_ci#define BPHY_RSSI_LUT 0x88 18468c2ecf20Sopenharmony_ci#define BPHY_RSSI_LUT_END 0xa7 18478c2ecf20Sopenharmony_ci#define BPHY_TSSI_LUT 0xa8 18488c2ecf20Sopenharmony_ci#define BPHY_TSSI_LUT_END 0xc7 18498c2ecf20Sopenharmony_ci#define BPHY_TSSI2PWR_LUT 0x380 18508c2ecf20Sopenharmony_ci#define BPHY_TSSI2PWR_LUT_END 0x39f 18518c2ecf20Sopenharmony_ci#define BPHY_LOCOMP_LUT 0x3a0 18528c2ecf20Sopenharmony_ci#define BPHY_LOCOMP_LUT_END 0x3bf 18538c2ecf20Sopenharmony_ci#define BPHY_TXGAIN_LUT 0x3c0 18548c2ecf20Sopenharmony_ci#define BPHY_TXGAIN_LUT_END 0x3ff 18558c2ecf20Sopenharmony_ci 18568c2ecf20Sopenharmony_ci/* Bits in BB_CONFIG: */ 18578c2ecf20Sopenharmony_ci#define PHY_BBC_ANT_MASK 0x0180 18588c2ecf20Sopenharmony_ci#define PHY_BBC_ANT_SHIFT 7 18598c2ecf20Sopenharmony_ci#define BB_DARWIN 0x1000 18608c2ecf20Sopenharmony_ci#define BBCFG_RESETCCA 0x4000 18618c2ecf20Sopenharmony_ci#define BBCFG_RESETRX 0x8000 18628c2ecf20Sopenharmony_ci 18638c2ecf20Sopenharmony_ci/* Bits in phytest(0x0a): */ 18648c2ecf20Sopenharmony_ci#define TST_DDFS 0x2000 18658c2ecf20Sopenharmony_ci#define TST_TXFILT1 0x0800 18668c2ecf20Sopenharmony_ci#define TST_UNSCRAM 0x0400 18678c2ecf20Sopenharmony_ci#define TST_CARR_SUPP 0x0200 18688c2ecf20Sopenharmony_ci#define TST_DC_COMP_LOOP 0x0100 18698c2ecf20Sopenharmony_ci#define TST_LOOPBACK 0x0080 18708c2ecf20Sopenharmony_ci#define TST_TXFILT0 0x0040 18718c2ecf20Sopenharmony_ci#define TST_TXTEST_ENABLE 0x0020 18728c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE 0x0018 18738c2ecf20Sopenharmony_ci#define TST_TXTEST_PHASE 0x0007 18748c2ecf20Sopenharmony_ci 18758c2ecf20Sopenharmony_ci/* phytest txTestRate values */ 18768c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE_1MBPS 0 18778c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE_2MBPS 1 18788c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE_5_5MBPS 2 18798c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE_11MBPS 3 18808c2ecf20Sopenharmony_ci#define TST_TXTEST_RATE_SHIFT 3 18818c2ecf20Sopenharmony_ci 18828c2ecf20Sopenharmony_ci#define SHM_BYT_CNT 0x2 /* IHR location */ 18838c2ecf20Sopenharmony_ci#define MAX_BYT_CNT 0x600 /* Maximum frame len */ 18848c2ecf20Sopenharmony_ci 18858c2ecf20Sopenharmony_cistruct d11cnt { 18868c2ecf20Sopenharmony_ci u32 txfrag; 18878c2ecf20Sopenharmony_ci u32 txmulti; 18888c2ecf20Sopenharmony_ci u32 txfail; 18898c2ecf20Sopenharmony_ci u32 txretry; 18908c2ecf20Sopenharmony_ci u32 txretrie; 18918c2ecf20Sopenharmony_ci u32 rxdup; 18928c2ecf20Sopenharmony_ci u32 txrts; 18938c2ecf20Sopenharmony_ci u32 txnocts; 18948c2ecf20Sopenharmony_ci u32 txnoack; 18958c2ecf20Sopenharmony_ci u32 rxfrag; 18968c2ecf20Sopenharmony_ci u32 rxmulti; 18978c2ecf20Sopenharmony_ci u32 rxcrc; 18988c2ecf20Sopenharmony_ci u32 txfrmsnt; 18998c2ecf20Sopenharmony_ci u32 rxundec; 19008c2ecf20Sopenharmony_ci}; 19018c2ecf20Sopenharmony_ci 19028c2ecf20Sopenharmony_ci#endif /* _BRCM_D11_H_ */ 1903