亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? htc_internal.h

?? WLAN在AR6000程序中的驅動代碼
?? H
字號:
//------------------------------------------------------------------------------
// <copyright file="htc_internal.h" company="Atheros">
//    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
//    Copyright (c) 2006 Atheros Corporation.  All rights reserved.
//
//    The use and distribution terms for this software are covered by the
//    Microsoft Limited Permissive License (Ms-LPL) 
//    http://www.microsoft.com/resources/sharedsource/licensingbasics/limitedpermissivelicense.mspx 
//    which can be found in the file MS-LPL.txt at the root of this distribution.
//    By using this software in any fashion, you are agreeing to be bound by
//    the terms of this license.
//
//    You must not remove this notice, or any other, from this software.
// </copyright>
// 
// <summary>
//    Windows CE Wifi Driver for AR-6000
// </summary>
//------------------------------------------------------------------------------
//==============================================================================
// HTC internal specific declarations and prototypes
//
// Author(s): ="Atheros"
//==============================================================================

#ifndef _HTC_INTERNAL_H_
#define _HTC_INTERNAL_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* Header files */
#include "athdefs.h"
#include "athtypes.h"
#include "AR6000/hw/mbox_host_reg.h"
#include "AR6000/hw/rtc_reg.h"
#include "htc.h"
#include "AR6000/AR6000_bmi.h"
#include "osapi.h"
#include "hif.h"

/* HTC operational parameters */
#define HTC_GLOBAL_EVENT_NUM_MAX           2 /* Target available/unavailable */
#define HTC_ENDPOINT_EVENT_NUM_MAX         5 /* Endpoint specific */
#define HTC_REG_REQUEST_LIST_SIZE          16
#define HTC_MESSAGE_SIZE_MAX               1536 - HTC_HEADER_LEN /* Default maximum message size for each mailbox */
#define HTC_TX_CREDITS_NUM_MAX             64
#define HTC_TARGET_RESPONSE_TIMEOUT        2000 /* in ms */

/* Useful macros */
#define GET_ENDPOINT_ID(endPoint) (endPoint - endPoint->target->endPoint)


/* ------- Event Related Data Structures ------- */
typedef struct htc_event_map HTC_EVENT_MAP;
typedef struct event_table_element EVENT_TABLE_ELEMENT;
typedef struct htc_endpoint_event_table HTC_ENDPOINT_EVENT_TABLE;
typedef struct htc_global_event_table HTC_GLOBAL_EVENT_TABLE;

#define FRAME_EVENT(_eventInfo, _buffer, _bufferLength,   \
                    _actualLength, _status, _cookie) do { \
    _eventInfo.buffer  = _buffer;                         \
    _eventInfo.bufferLength = _bufferLength;              \
    _eventInfo.actualLength = _actualLength;              \
    _eventInfo.status = _status;                          \
    _eventInfo.cookie = _cookie;                          \
} while (0)

struct event_table_element {
    HTC_EVENT_ID         id;
    HTC_EVENT_HANDLER    handler;
    void                *param;
};

struct htc_endpoint_event_table {
    EVENT_TABLE_ELEMENT element[HTC_ENDPOINT_EVENT_NUM_MAX];
};

struct htc_global_event_table {
    EVENT_TABLE_ELEMENT element[HTC_GLOBAL_EVENT_NUM_MAX];

};

/* ------ Mailbox Related Data Structures ------ */
typedef struct htc_queue_element HTC_QUEUE_ELEMENT, HTC_REG_REQUEST_ELEMENT, HTC_DATA_REQUEST_ELEMENT;
typedef struct htc_mbox_buffer HTC_MBOX_BUFFER;
typedef struct htc_reg_buffer HTC_REG_BUFFER;
typedef struct htc_data_request_queue HTC_DATA_REQUEST_QUEUE;
typedef struct htc_reg_request_list HTC_REG_REQUEST_LIST;
typedef struct htc_endpoint HTC_ENDPOINT;

typedef enum {
    INT_STATUS_REG,
    ERROR_INT_STATUS_REG,
    CPU_INT_STATUS_REG,
    RX_LOOKAHEAD_VALID_REG,
    RX_LOOKAHEAD0_REG,
    RX_LOOKAHEAD1_REG,
    RX_LOOKAHEAD2_REG,
    RX_LOOKAHEAD3_REG,
    TX_CREDIT_COUNTER_REG,
    TX_CREDIT_COUNTER_RESET_REG,
    TX_CREDIT_COUNTER_DECREMENT_REG,
    SCRATCH_REG,
    INT_STATUS_ENABLE_REG,
    CPU_INT_STATUS_ENABLE_REG,
    ERROR_STATUS_ENABLE_REG,
    COUNTER_INT_STATUS_READ_REG,
    COUNTER_INT_STATUS_ENABLE_REG,
    COUNTER_INT_STATUS_DISABLE_REG,
    INT_WLAN_REG,
    WINDOW_DATA_REG,
    WINDOW_WRITE_ADDR_REG,
    WINDOW_READ_ADDR_REG
} TARGET_REGISTERS;

#define SET_TX_CREDITS_AVAILABLE(endPoint, credits) \
                                    endPoint->txCreditsAvailable[0] = (credits)
#define SET_TX_CREDITS_CONSUMED(endPoint, credits) \
                                    endPoint->txCreditsConsumed = (credits)
#define GET_TX_CREDITS_AVAILABLE(endPoint) \
                                    endPoint->txCreditsAvailable[0]
#define GET_TX_CREDITS_CONSUMED(endPoint) \
                                    endPoint->txCreditsConsumed

#define IS_ELEMENT_FREE(element)	element->buffer.free
#define GET_MBOX_BUFFER(element)	&((element)->buffer.u.mboxBuffer)
#define GET_REG_BUFFER(element)		&((element)->buffer.u.regBuffer)
#define GET_QUEUE_TAIL(queue)		&queue->element[(queue->head + queue->size) % HTC_DATA_REQUEST_RING_BUFFER_SIZE]
#define GET_QUEUE_HEAD(queue)		&queue->element[queue->head]
#define IS_DATA_QUEUE_EMPTY(queue)      (!queue->size)
#define IS_DATA_QUEUE_FULL(queue)       (!(HTC_DATA_REQUEST_RING_BUFFER_SIZE - queue->size))

#define RECYCLE_DATA_REQUEST_ELEMENT(element) do { \
    FILL_MBOX_BUFFER(element, NULL, 0, 0, NULL); \
    (element)->buffer.free = TRUE; \
} while (0)

#define FILL_MBOX_BUFFER(element, _buffer, _bufferLength, _actualLength, _cookie) do { \
    (GET_MBOX_BUFFER(element))->buffer = _buffer; \
    (GET_MBOX_BUFFER(element))->bufferLength = _bufferLength; \
    (GET_MBOX_BUFFER(element))->actualLength = _actualLength; \
    (GET_MBOX_BUFFER(element))->cookie = _cookie; \
} while (0)

#define FILL_REG_BUFFER(element, _buffer, _length, _base, _offset) do { \
    (GET_REG_BUFFER(element))->buffer = _buffer; \
    (GET_REG_BUFFER(element))->length = _length; \
    (GET_REG_BUFFER(element))->base = _base; \
    (GET_REG_BUFFER(element))->offset = _offset; \
} while (0)

struct htc_queue_element {
    A_STATUS	(*completionCB)(HTC_QUEUE_ELEMENT *element, A_STATUS status);
    struct htc_buffer {
        /* In use or available */
        A_BOOL	free;
        union {
            struct htc_mbox_buffer {
                /* 
                 * Given by the caller and is associated with the buffer being 
                 * queued up.
                 */
                void			*cookie;

                /* 
                 * Pointer to the start of the buffer. In the transmit 
                 * direction this points to the start of the payload. In the 
                 * receive direction, however, the buffer when queued up 
                 * points to the start of the HTC header but when returned 
                 * to the caller points to the start of the payload 
                 */
                A_UCHAR			*buffer;

                /* Holds the length of the buffer */
                A_UINT32		bufferLength;

                /* Holds the length of the payload */
                A_UINT32		actualLength;

                HTC_ENDPOINT    *endPoint;
            } mboxBuffer;
            struct htc_reg_buffer {
                HTC_TARGET		*target;
#ifdef ONLY_16BIT
                A_UINT16        *buffer;
#else
                A_UCHAR			*buffer;
#endif
                A_UINT32		length;
                TARGET_REGISTERS	base;
                A_UINT32		offset;
            } regBuffer;
        } u;
    } buffer;
};

/* This is a FIFO queue of the pending data read/write requests. When a request
has to be issued, the element at the head of the queue is dequeued and
processed. New requests are added at the tail of the queue. The queue can only
support a fixed number of requests and stops adding new requests once the total
number of requests that are pending to be processed and the ones that are still
under process reach the queue capacity */
struct htc_data_request_queue {
    A_UINT32                  head;
    A_UINT32                  size;
    HTC_DATA_REQUEST_ELEMENT  element[HTC_DATA_REQUEST_RING_BUFFER_SIZE];
};

/* This is a list of 'free' register read/write requests. When a request has to 
be issued an element is taken from this list and after the completion of the 
request is added back to the list */
struct htc_reg_request_list {
    HTC_REG_REQUEST_ELEMENT  element[HTC_REG_REQUEST_LIST_SIZE];
};

struct htc_endpoint {
    /* Enabled or Disabled */
    A_BOOL                   enabled;

    /*
     * Used to hold the length of the frame received from the target in 
     * case there are no buffers that have been queued up to receive the 
     * data.
     */
    A_UINT32                 rxLengthPending; 

#ifdef ONLY_16BIT
    /* Number of frames for which the target has space for at any time */
    A_UINT16                  txCreditsAvailable[1 + HTC_TX_CREDITS_NUM_MAX];

    /* 
     * Number of frames that have been sent since the transmit credits 
     * were last updated.
     */
    A_UINT16                  txCreditsConsumed; 
#else
    /* Number of frames for which the target has space for at any time */
    A_UINT8                  txCreditsAvailable[1 + HTC_TX_CREDITS_NUM_MAX];

    /* 
     * Number of frames that have been sent since the transmit credits 
     * were last updated.
     */
    A_UINT8                  txCreditsConsumed; 
#endif

    A_BOOL                   txCreditsIntrEnable;

    /* Pending Send Queue */
    HTC_DATA_REQUEST_QUEUE   sendQueue; 

    /* Pending Receive Queue */
    HTC_DATA_REQUEST_QUEUE   recvQueue; 

    /* Inverse reference to the target */
    HTC_TARGET              *target;

    /* Block size configured for the endpoint */
    A_UINT32                 blockSize;

    /* Event Table */
    HTC_ENDPOINT_EVENT_TABLE eventTable; 
};

/* ------- Target Related Data structures ------- */
typedef struct htc_register_table HTC_REGISTER_TABLE;

/* 
 * The following Register table only contain those registers that are used 
 * in HTC. It does not reflect the actual register layout in the hardware 
 */
struct htc_register_table {
    A_UINT8                      host_int_status;
    A_UINT8                      cpu_int_status;
    A_UINT8                      error_int_status;
    A_UINT8                      counter_int_status;
    A_UINT8                      mbox_frame;
    A_UINT8                      rx_lookahead_valid;
    A_UINT8                      hole[2];
    A_UINT32                     rx_lookahead[HTC_MAILBOX_NUM_MAX];
    A_UINT8                      int_status_enable;
    A_UINT8                      cpu_int_status_enable;
    A_UINT8                      error_status_enable;
    A_UINT8                      counter_int_status_enable;
#ifdef ONLY_16BIT
    A_UINT16                     int_wlan;
#else
    A_UINT8                      int_wlan;
#endif
};

struct htc_target {
    A_BOOL                       ready;
    void                        *device; /* Handle to the device instance 
                                            reported by the bus driver */
    HTC_ENDPOINT                 endPoint[HTC_MAILBOX_NUM_MAX];
    HTC_REGISTER_TABLE           table;
    HTC_REG_REQUEST_LIST         regList;
};


/* ------- Function Prototypes for Receive -------- */
void
htcReceiveFrame(HTC_ENDPOINT *endPoint);

A_UINT32
htcGetFrameLength(HTC_ENDPOINT *endPoint);


/* ------- Function Prototypes for Transmit -------- */
void 
htcSendFrame(HTC_ENDPOINT *endPoint);

void
htcSendBlkSize(HTC_ENDPOINT *endPoint);


/* ------- Function Prototypes for Events and Callbacks  ------- */
A_STATUS
htcRWCompletionHandler(void *element, 
                       A_STATUS status);

A_STATUS 
htcTxCompletionCB(HTC_DATA_REQUEST_ELEMENT *element,
                  A_STATUS status);

A_STATUS
htcBlkSzNegCompletionCB(HTC_DATA_REQUEST_ELEMENT *element,
                        A_STATUS status);

A_STATUS
htcRxCompletionCB(HTC_DATA_REQUEST_ELEMENT *element, 
                  A_STATUS status);

A_STATUS
htcRegCompletionCB(HTC_REG_REQUEST_ELEMENT *element,
                   A_STATUS status);

A_STATUS
htcTargetInsertedHandler(HIF_DEVICE *device);

A_STATUS
htcTargetRemovedHandler(HIF_DEVICE *device);

A_STATUS
htcDSRHandler(HIF_DEVICE *device);

A_STATUS
htcInterruptDisabler(HIF_DEVICE *device,A_BOOL *callDsr);

A_STATUS
htcInterruptPending(HIF_DEVICE *device, A_BOOL *intPending);

A_STATUS
htcInterruptEnabler(HIF_DEVICE *device);
#ifdef HTC_SYNC
A_STATUS
htcISRHandler(HIF_DEVICE *device);
#endif

void
htcServiceCPUInterrupt(HTC_TARGET *target);

void
htcServiceErrorInterrupt(HTC_TARGET *target);

void
htcServiceCounterInterrupt(HTC_TARGET *target);

void
htcServiceMailboxInterrupt(HTC_TARGET *target);

void
htcEnableCreditCounterInterrupt(HTC_TARGET *target, 
                                HTC_ENDPOINT_ID endPointId);

void
htcDisableCreditCounterInterrupt(HTC_TARGET *target, 
                                 HTC_ENDPOINT_ID endPointId);

/* ------- Function Prototypes for Utility routines ------- */
A_STATUS
addToMboxQueue(HTC_DATA_REQUEST_QUEUE *queue,
               A_UCHAR        *buffer,
               A_UINT32        bufferLength,
               A_UINT32        actualLength,
               void           *cookie);

HTC_DATA_REQUEST_ELEMENT *
removeFromMboxQueue(HTC_DATA_REQUEST_QUEUE *queue);

void
flushMboxQueue(HTC_ENDPOINT *endPoint,
               HTC_DATA_REQUEST_QUEUE *queue, 
               HTC_EVENT_ID eventId);

HTC_REG_REQUEST_ELEMENT *
allocateRegRequestElement(HTC_TARGET *target);

void
freeRegRequestElement(HTC_REG_REQUEST_ELEMENT *element);

A_STATUS 
addToEventTable(HTC_TARGET       *target,
                HTC_ENDPOINT_ID   endPointId,
                HTC_EVENT_ID      eventId,
                HTC_EVENT_HANDLER handler, 
                void             *param);

A_STATUS 
removeFromEventTable(HTC_TARGET *target,
                     HTC_ENDPOINT_ID endPointId,
                     HTC_EVENT_ID  eventId);

void
dispatchEvent(HTC_TARGET     *target, 
              HTC_ENDPOINT_ID endPointId,
              HTC_EVENT_ID    eventId, 
              HTC_EVENT_INFO *eventInfo);

HTC_TARGET *
getTargetInstance(void *device);

void
addTargetInstance(HTC_TARGET *target);

void
delTargetInstance(HTC_TARGET *target);

A_UINT32 
getRegAddr(TARGET_REGISTERS base, 
           HTC_ENDPOINT_ID endPointId);

A_UINT8
htcGetBitNumSet(A_UINT32 data);

void
dumpBytes(A_UCHAR *buffer, A_UINT16 length);

void
dumpRegisters(HTC_TARGET *target);

#ifdef __cplusplus
}
#endif

#endif /* _HTC_INTERNAL_H_ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大白屁股肥臀xxxxxx| 亚洲色图第一区| 亚洲欧洲成人自拍| 日本在线播放一区二区三区| 国产精品一级二级三级| 91国偷自产一区二区三区观看 | 天天av天天翘天天综合网| 国产一区二区三区| 欧美日韩成人综合| 国产精品福利一区| 国产一区二区毛片| 欧美疯狂性受xxxxx喷水图片| 亚洲欧美一区二区在线观看| 激情综合网激情| 欧美日韩一区二区电影| 亚洲精品欧美激情| 99久久99久久综合| 国产精品视频第一区| 国产一级精品在线| 久久天天做天天爱综合色| 日韩激情视频在线观看| 欧美视频第二页| 亚洲韩国精品一区| 成人a免费在线看| 国产精品美女久久久久久久久久久| 精品夜夜嗨av一区二区三区| 欧美电影一区二区三区| 亚洲国产一二三| 欧美天天综合网| 性做久久久久久久免费看| 91国产视频在线观看| 一级女性全黄久久生活片免费| 色综合天天性综合| 亚洲乱码国产乱码精品精小说 | 亚洲欧美国产高清| 99久久夜色精品国产网站| 中文字幕av一区二区三区免费看| 国产精品66部| 国产精品私人自拍| 国产999精品久久久久久| 国产午夜精品在线观看| 成人综合婷婷国产精品久久蜜臀| 亚洲国产精品成人久久综合一区| 成人18视频在线播放| 亚洲人成网站色在线观看| 欧美午夜精品一区二区三区| 三级成人在线视频| 精品国产一区二区三区四区四 | 国产精品综合在线视频| 久久奇米777| 成人国产精品免费观看| 一区二区三区在线观看视频| 欧美日韩免费视频| 韩国三级在线一区| 国产精品动漫网站| 欧美色综合网站| 蜜桃视频在线一区| 国产亚洲精品aa| 91蜜桃免费观看视频| 婷婷国产v国产偷v亚洲高清| 337p粉嫩大胆噜噜噜噜噜91av| 成人免费视频一区| 亚洲第一精品在线| 国产亚洲成aⅴ人片在线观看| 99re视频精品| 青青草原综合久久大伊人精品| 久久久久99精品一区| 91极品视觉盛宴| 韩日欧美一区二区三区| 亚洲综合自拍偷拍| 久久亚洲综合色| 在线观看一区二区精品视频| 国产一区二区精品久久| 亚洲一二三区不卡| 国产欧美视频在线观看| 色爱区综合激月婷婷| 国产麻豆精品theporn| 午夜电影久久久| 中文字幕制服丝袜成人av| 欧美一区二区不卡视频| 色综合久久88色综合天天| 国产麻豆精品95视频| 五月天精品一区二区三区| 亚洲特级片在线| 亚洲精品在线电影| 51久久夜色精品国产麻豆| 99国产麻豆精品| 国产在线视视频有精品| 日韩电影免费一区| 亚洲一区二区在线免费看| 国产精品美女久久久久久久久久久| 日韩美女在线视频| 欧美日韩精品专区| 这里只有精品视频在线观看| 成人av动漫在线| 国产原创一区二区| 美女视频免费一区| 亚洲大尺度视频在线观看| 国产精品麻豆久久久| xnxx国产精品| 2020日本不卡一区二区视频| 91精品国产综合久久精品app | 成人国产精品免费| 久久国产精品72免费观看| 午夜久久电影网| 亚洲最新在线观看| 一区二区三区.www| 亚洲精品国产精品乱码不99 | 国产女同互慰高潮91漫画| 日韩一卡二卡三卡国产欧美| 欧美视频精品在线观看| 欧美视频在线一区| 欧美精品在线一区二区三区| 欧美日韩高清一区| 欧美日韩一区在线| 欧美一区二区三区精品| 91精品免费在线| 欧美一区二区日韩一区二区| 91麻豆精品国产91久久久资源速度| 欧美三日本三级三级在线播放| 欧美图片一区二区三区| 69av一区二区三区| 日韩午夜激情视频| 亚洲精品一区在线观看| 国产欧美精品区一区二区三区 | 色婷婷综合久久| 日本乱码高清不卡字幕| 欧美日韩1区2区| 91精品国产全国免费观看| 欧美变态口味重另类| 日本一区二区三区电影| 欧美韩国日本一区| 一区二区三区在线影院| 午夜精品一区在线观看| 老司机午夜精品| 国产黑丝在线一区二区三区| 99视频一区二区三区| 欧美日韩国产成人在线免费| 日韩欧美色综合网站| 国产色婷婷亚洲99精品小说| 亚洲日本欧美天堂| 午夜精品一区二区三区免费视频 | 亚洲一卡二卡三卡四卡无卡久久 | 2020国产成人综合网| 国产蜜臀97一区二区三区| 亚洲精品一二三| 日韩1区2区3区| 国产精品自拍av| 欧洲精品一区二区三区在线观看| 日韩美一区二区三区| 亚洲日本在线视频观看| 久久99热国产| 在线视频你懂得一区| 国产亚洲制服色| 亚洲午夜私人影院| 国产精品一区久久久久| 久久亚洲精华国产精华液| 最新日韩在线视频| 老汉av免费一区二区三区 | 自拍偷拍国产精品| 日韩福利视频导航| av电影在线不卡| 日韩欧美一级精品久久| 一区二区三区四区在线免费观看| 久久99久国产精品黄毛片色诱| 色综合亚洲欧洲| 久久视频一区二区| 婷婷久久综合九色国产成人| 91在线观看免费视频| 日韩免费一区二区三区在线播放| 国产精品毛片久久久久久久| 久久国产尿小便嘘嘘尿| 欧美少妇bbb| 依依成人精品视频| 国产91色综合久久免费分享| 91精品欧美综合在线观看最新 | 国产精品久久久久久久浪潮网站 | 北条麻妃国产九九精品视频| 精品国产91亚洲一区二区三区婷婷| 亚洲午夜激情网页| 91麻豆自制传媒国产之光| 国产亚洲综合av| 久久成人久久爱| 日韩免费观看2025年上映的电影| 午夜精品久久久久久久| 欧美午夜片在线观看| 亚洲品质自拍视频网站| 成人一级黄色片| 欧美激情一区在线观看| 国产精品中文字幕日韩精品| 精品1区2区在线观看| 国精产品一区一区三区mba视频| 欧美一区二区三区视频免费| 亚洲线精品一区二区三区八戒| 色欧美片视频在线观看| 亚洲另类一区二区| 95精品视频在线| 亚洲免费伊人电影| 在线观看一区不卡| 亚洲成国产人片在线观看|