Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/cache/sources/wl/include/bcmcdc.h
Views: 3959
/*1* CDC network driver ioctl/indication encoding2* Broadcom 802.11abg Networking Device Driver3*4* Definitions subject to change without notice.5*6* $Copyright Open Broadcom Corporation$7*8* $Id: bcmcdc.h 291086 2011-10-21 01:17:24Z linm $9*/10#ifndef _bcmcdc_h_11#define _bcmcdc_h_12#include <proto/ethernet.h>1314typedef struct cdc_ioctl {15uint32 cmd; /* ioctl command value */16uint32 len; /* lower 16: output buflen; upper 16: input buflen (excludes header) */17uint32 flags; /* flag defns given below */18uint32 status; /* status code returned from the device */19} cdc_ioctl_t;2021/* Max valid buffer size that can be sent to the dongle */22#define CDC_MAX_MSG_SIZE ETHER_MAX_LEN2324/* len field is divided into input and output buffer lengths */25#define CDCL_IOC_OUTLEN_MASK 0x0000FFFF /* maximum or expected response length, */26/* excluding IOCTL header */27#define CDCL_IOC_OUTLEN_SHIFT 028#define CDCL_IOC_INLEN_MASK 0xFFFF0000 /* input buffer length, excluding IOCTL header */29#define CDCL_IOC_INLEN_SHIFT 163031/* CDC flag definitions */32#define CDCF_IOC_ERROR 0x01 /* 0=success, 1=ioctl cmd failed */33#define CDCF_IOC_SET 0x02 /* 0=get, 1=set cmd */34#define CDCF_IOC_OVL_IDX_MASK 0x3c /* overlay region index mask */35#define CDCF_IOC_OVL_RSV 0x40 /* 1=reserve this overlay region */36#define CDCF_IOC_OVL 0x80 /* 1=this ioctl corresponds to an overlay */37#define CDCF_IOC_ACTION_MASK 0xfe /* SET/GET, OVL_IDX, OVL_RSV, OVL mask */38#define CDCF_IOC_ACTION_SHIFT 1 /* SET/GET, OVL_IDX, OVL_RSV, OVL shift */39#define CDCF_IOC_IF_MASK 0xF000 /* I/F index */40#define CDCF_IOC_IF_SHIFT 1241#define CDCF_IOC_ID_MASK 0xFFFF0000 /* used to uniquely id an ioctl req/resp pairing */42#define CDCF_IOC_ID_SHIFT 16 /* # of bits of shift for ID Mask */4344#define CDC_IOC_IF_IDX(flags) (((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)45#define CDC_IOC_ID(flags) (((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)4647#define CDC_GET_IF_IDX(hdr) \48((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))49#define CDC_SET_IF_IDX(hdr, idx) \50((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | ((idx) << CDCF_IOC_IF_SHIFT)))5152/*53* BDC header54*55* The BDC header is used on data packets to convey priority across USB.56*/5758#define BDC_HEADER_LEN 45960#define BDC_PROTO_VER_1 1 /* Old Protocol version */61#define BDC_PROTO_VER 2 /* Protocol version */6263#define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */64#define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */6566#ifndef EXT_STA67#define BDC_FLAG__UNUSED 0x03 /* Unassigned */68#else69#define BDC_FLAG_EXEMPT 0x03 /* Vista/EXT_STA: use for encryption exemption */70#endif /* EXT_STA */71#define BDC_FLAG_SUM_GOOD 0x04 /* Dongle has verified good RX checksums */72#define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */7374#define BDC_PRIORITY_MASK 0x77576#define BDC_FLAG2_FC_FLAG 0x10 /* flag to indicate if pkt contains */77/* FLOW CONTROL info only */78#define BDC_PRIORITY_FC_SHIFT 4 /* flow control info shift */7980#define BDC_FLAG2_IF_MASK 0x0f /* APSTA: interface on which the packet was received */81#define BDC_FLAG2_IF_SHIFT 082/* XXX PR86912 WAR: host pads out to multiple of 64 bytes; device trims pad bytes */83#define BDC_FLAG2_PAD_MASK 0xf084#define BDC_FLAG_PAD_MASK 0x0385#define BDC_FLAG2_PAD_SHIFT 286#define BDC_FLAG_PAD_SHIFT 087#define BDC_FLAG2_PAD_IDX 0x3c88#define BDC_FLAG_PAD_IDX 0x0389#define BDC_GET_PAD_LEN(hdr) \90((int)(((((hdr)->flags2) & BDC_FLAG2_PAD_MASK) >> BDC_FLAG2_PAD_SHIFT) | \91((((hdr)->flags) & BDC_FLAG_PAD_MASK) >> BDC_FLAG_PAD_SHIFT)))92#define BDC_SET_PAD_LEN(hdr, idx) \93((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_PAD_MASK) | \94(((idx) & BDC_FLAG2_PAD_IDX) << BDC_FLAG2_PAD_SHIFT))); \95((hdr)->flags = (((hdr)->flags & ~BDC_FLAG_PAD_MASK) | \96(((idx) & BDC_FLAG_PAD_IDX) << BDC_FLAG_PAD_SHIFT)))97/* XXX END PR86912 WAR */9899#define BDC_GET_IF_IDX(hdr) \100((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))101#define BDC_SET_IF_IDX(hdr, idx) \102((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | ((idx) << BDC_FLAG2_IF_SHIFT)))103104struct bdc_header {105uint8 flags; /* Flags */106uint8 priority; /* 802.1d Priority 0:2 bits, 4:7 USB flow control info */107uint8 flags2;108uint8 dataOffset; /* Offset from end of BDC header to packet data, in109* 4-byte words. Leaves room for optional headers.110*/111};112113/* XXX: Just to keep support for old twigs */114#define BDC_PROTO_VER_1 1 /* Old Protocol version */115116#endif /* _bcmcdc_h_ */117118119