設置 | 登錄 | 註冊

目前共有2篇帖子。

【笔记】whd_chip_specific_init

4樓 巨大八爪鱼 2025-11-30 20:55

前36字节([0-35)的数据结构:

typedef struct
{

  bus_common_header_t common; // 20字节 [0~19]
  cdc_header_t cdc_header; // 16字节 [20~35]
} control_header_t; // 36字节


typedef struct
{
  whd_buffer_header_t buffer_header; // 8字节 [0~7](CMD53不发送此数据)
  uint8_t bus_header[BUS_HEADER_LEN]; // 12字节 (sdpcm_header_t) [8~19]
} bus_common_header_t;


typedef struct
{

  whd_buffer_queue_ptr_t queue_next; // 4字节 (struct pbuf *) [0~3](CMD53不发送此数据)
  char bus_header[MAX_BUS_HEADER_SIZE]; // 4字节 (whd_transfer_bytes_packet_t::bus_header) [4~7](CMD53不发送此数据)
} whd_buffer_header_t;


typedef struct
{

  uint8_t bus_header[MAX_BUS_HEADER_SIZE]; // [4-7]
  uint32_t data[1]; // [8-]

} whd_transfer_bytes_packet_t;


typedef struct
{
  uint16_t frametag[2]; // 4字节 {size, ~size} [8~11]
  sdpcm_sw_header_t sw_header; // 6+2=8字节 (channel_and_flags, header_length, sequence) [12~19]

} sdpcm_header_t; // 共12字节


typedef struct
{
  uint8_t sequence;               /* Rx/Tx sequence number */ // [12]
  uint8_t channel_and_flags;      /*  4 MSB Channel number, 4 LSB arbitrary flag */ // [13]
  uint8_t next_length;            /* Length of next data frame, reserved for Tx */ // [14]
  uint8_t header_length;          /* Data offset */ // [15]
  uint8_t wireless_flow_control;  /* Flow control bits, reserved for Tx */ // [16]
  uint8_t bus_data_credit;        /* Maximum Sequence number allowed by firmware for Tx */ // [17]
  uint8_t _reserved[2];           /* Reserved */ // [18-19]

} sdpcm_sw_header_t;


typedef struct
{

  uint32_t cmd;    /* ioctl command value */ // [20~23]
  uint32_t len;    /* lower 16: output buflen; upper 16: input buflen (excludes header) */ // [24~27]
  uint32_t flags;  /* flag defns given in bcmcdc.h */ // [28~31]
  uint32_t status; /* status code returned from the device */ // [32~35]

} cdc_header_t;

巨大八爪鱼 2026-5-9 11:42

typedef void *whd_buffer_t;
typedef whd_buffer_t whd_buffer_queue_ptr_t;

真绕啊,虽然写成void *,但这两个类型实际上是lwip协议栈里面的struct pbuf *。

內容轉換:

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張