linux/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2010 Broadcom Corporation
 */

#ifndef	_BRCMU_D11_H_
#define _BRCMU_D11_H_

/* d11 io type */
#define BRCMU_D11N_IOTYPE
#define BRCMU_D11AC_IOTYPE

/* A chanspec (channel specification) holds the channel number, band,
 * bandwidth and control sideband
 */

/* chanspec binary format */

#define BRCMU_CHSPEC_INVALID
/* bit 0~7 channel number
 * for 80+80 channels: bit 0~3 low channel id, bit 4~7 high channel id
 */
#define BRCMU_CHSPEC_CH_MASK
#define BRCMU_CHSPEC_CH_SHIFT
#define BRCMU_CHSPEC_CHL_MASK
#define BRCMU_CHSPEC_CHL_SHIFT
#define BRCMU_CHSPEC_CHH_MASK
#define BRCMU_CHSPEC_CHH_SHIFT

/* bit 8~16 for dot 11n IO types
 * bit 8~9 sideband
 * bit 10~11 bandwidth
 * bit 12~13 spectral band
 * bit 14~15 not used
 */
#define BRCMU_CHSPEC_D11N_SB_MASK
#define BRCMU_CHSPEC_D11N_SB_SHIFT
#define BRCMU_CHSPEC_D11N_SB_L
#define BRCMU_CHSPEC_D11N_SB_U
#define BRCMU_CHSPEC_D11N_SB_N
#define BRCMU_CHSPEC_D11N_BW_MASK
#define BRCMU_CHSPEC_D11N_BW_SHIFT
#define BRCMU_CHSPEC_D11N_BW_10
#define BRCMU_CHSPEC_D11N_BW_20
#define BRCMU_CHSPEC_D11N_BW_40
#define BRCMU_CHSPEC_D11N_BND_MASK
#define BRCMU_CHSPEC_D11N_BND_SHIFT
#define BRCMU_CHSPEC_D11N_BND_5G
#define BRCMU_CHSPEC_D11N_BND_2G

/* bit 8~16 for dot 11ac IO types
 * bit 8~10 sideband
 * bit 11~13 bandwidth
 * bit 14~15 spectral band
 */
#define BRCMU_CHSPEC_D11AC_SB_MASK
#define BRCMU_CHSPEC_D11AC_SB_SHIFT
#define BRCMU_CHSPEC_D11AC_SB_LLL
#define BRCMU_CHSPEC_D11AC_SB_LLU
#define BRCMU_CHSPEC_D11AC_SB_LUL
#define BRCMU_CHSPEC_D11AC_SB_LUU
#define BRCMU_CHSPEC_D11AC_SB_ULL
#define BRCMU_CHSPEC_D11AC_SB_ULU
#define BRCMU_CHSPEC_D11AC_SB_UUL
#define BRCMU_CHSPEC_D11AC_SB_UUU
#define BRCMU_CHSPEC_D11AC_SB_LL
#define BRCMU_CHSPEC_D11AC_SB_LU
#define BRCMU_CHSPEC_D11AC_SB_UL
#define BRCMU_CHSPEC_D11AC_SB_UU
#define BRCMU_CHSPEC_D11AC_SB_L
#define BRCMU_CHSPEC_D11AC_SB_U
#define BRCMU_CHSPEC_D11AC_BW_MASK
#define BRCMU_CHSPEC_D11AC_BW_SHIFT
#define BRCMU_CHSPEC_D11AC_BW_5
#define BRCMU_CHSPEC_D11AC_BW_10
#define BRCMU_CHSPEC_D11AC_BW_20
#define BRCMU_CHSPEC_D11AC_BW_40
#define BRCMU_CHSPEC_D11AC_BW_80
#define BRCMU_CHSPEC_D11AC_BW_160
#define BRCMU_CHSPEC_D11AC_BW_8080
#define BRCMU_CHSPEC_D11AC_BND_MASK
#define BRCMU_CHSPEC_D11AC_BND_SHIFT
#define BRCMU_CHSPEC_D11AC_BND_2G
#define BRCMU_CHSPEC_D11AC_BND_3G
#define BRCMU_CHSPEC_D11AC_BND_4G
#define BRCMU_CHSPEC_D11AC_BND_5G

#define BRCMU_CHAN_BAND_2G
#define BRCMU_CHAN_BAND_5G

enum brcmu_chan_bw {};

enum brcmu_chan_sb {};

/**
 * struct brcmu_chan - stores channel formats
 *
 * This structure can be used with functions translating chanspec into generic
 * channel info and the other way.
 *
 * @chspec: firmware specific format
 * @chnum: center channel number
 * @control_ch_num: control channel number
 * @band: frequency band
 * @bw: channel width
 * @sb: control sideband (location of control channel against the center one)
 */
struct brcmu_chan {};

/**
 * struct brcmu_d11inf - provides functions translating channel format
 *
 * @io_type: determines version of channel format used by firmware
 * @encchspec: encodes channel info into a chanspec, requires center channel
 *	number, ignores control one
 * @decchspec: decodes chanspec into generic info
 */
struct brcmu_d11inf {};

void brcmu_d11_attach(struct brcmu_d11inf *d11inf);

#endif	/* _BRCMU_CHANNELS_H_ */