1 bf = TAIL_FIRST(&sc->sc_rxbuf); // 获取队列的第一个数据
(1) #define TAIL_FIRST(head) ((head)->tqh_first)
(2) ath_bufhead sc_rxbuf; // 在struct ath_softc结构体里定义
2.1)typedef TAIL_HEAD(ath_bufhead_s,ath_buf) ath_bufhead;
2.1.1)#define TAIL_HEAD(name,type) \
struct name { \
struct type *tqh_first; \ //第一个元素
struct type **tqh_last; \
}
2 根据以上关系得出
(1) struct ath_bufhead_s {
struct ath_buf *tqh_first;
struct ath_buf **tqh_last;
} sc_rxbuf;
(2) 返回的数据则是sc->sc_rxbuf.tqh_first 即 (&(sc->sc_rxbuf))->tqh_first;
阅读(1528) | 评论(0) | 转发(0) |