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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bmi.c

?? WLAN在AR6000程序中的驅(qū)動(dòng)代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
//------------------------------------------------------------------------------
// <copyright file="bmi.c" 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>
//------------------------------------------------------------------------------
//==============================================================================
// This file contains the routines that implement the Boot loader messaging 
// interface
//
// Author(s): ="Atheros"
//==============================================================================

#include "hif.h"
#include "bmi.h"
#include "htc.h"
#include "bmi_internal.h"
#include "osapi.h"


/* Although we had envisioned BMI to run on top of HTC, this is not what the final implementation boiled down to on dragon. Its a part of BSP and does not use the HTC protocol either. On the host side, however, we were still living with the original idea. I think the time has come to accept the truth and separate it from HTC which has been carrying BMI's burden all this while. It shall make HTC state machine relatively simpler */

/* ------ Static Variables ------ */

/* ------ Global Variable Declarations ------- */
A_BOOL bmiDone;

/* APIs visible to the driver */
void
BMIInit(void) 
{
    bmiDone = FALSE;
}

A_STATUS 
BMIDone(HIF_DEVICE *device) 
{
    A_STATUS status;
    A_UINT32 cid;

    if (bmiDone) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Command disallowed\n");
        return A_ERROR;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Done: Enter (device: 0x%p)\n", device);
    bmiDone = TRUE;
    cid = BMI_DONE;

    status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
    if (status != A_OK) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to write to the device\n");
        return A_ERROR;
    }
    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Done: Exit\n");

    return A_OK;
}

A_STATUS 
BMIGetTargetId(HIF_DEVICE *device, A_UINT32 *id) 
{
    A_STATUS status;
    A_UINT32 cid;

    if (bmiDone) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Command disallowed\n");
        return A_ERROR;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Get Target ID: Enter (device: 0x%p)\n", device);
    cid = BMI_GET_TARGET_ID;

    status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
    if (status != A_OK) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to write to the device\n");
        return A_ERROR;
    }

    status = bmiBufferReceive(device, (A_UCHAR *)id, sizeof(*id));
    if (status != A_OK) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to read from the device\n");
        return A_ERROR;
    }
    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Get Target ID: Exit (ID: 0x%x)\n", *id);

    return A_OK;
}

A_STATUS 
BMIReadMemory(HIF_DEVICE *device, 
              A_UINT32 address, 
              A_UCHAR *buffer, 
              A_UINT32 length) 
{
    A_UINT32 cid;
    A_STATUS status;
    A_UINT32 offset;
    A_UINT32 remaining, rxlen;
    A_UCHAR data[BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length)];

    if (bmiDone) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Command disallowed\n");
        return A_ERROR;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,
       "BMI Read Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n", 
        device, address, length);

    cid = BMI_READ_MEMORY;

#ifdef ONLY_16BIT
    length = length + (length % 2);
#endif
    remaining = length;
    while (remaining)
    {
        rxlen = (remaining < BMI_DATASZ_MAX) ? remaining : BMI_DATASZ_MAX;
        offset = 0;
        A_MEMCPY(&data[offset], &cid, sizeof(cid));
        offset += sizeof(cid);
        A_MEMCPY(&data[offset], &address, sizeof(address));
        offset += sizeof(address);
        A_MEMCPY(&data[offset], &rxlen, sizeof(rxlen));
        offset += sizeof(length);
        status = bmiBufferSend(device, data, offset);
        if (status != A_OK) {
            BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to write to the device\n");
            return A_ERROR;
        }
        status = bmiBufferReceive(device, data, rxlen);
        if (status != A_OK) {
            BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to read from the device\n");
            return A_ERROR;
        }
        A_MEMCPY(&buffer[length - remaining], data, rxlen);
        remaining -= rxlen; address += rxlen;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Read Memory: Exit\n");
    return A_OK;
}

A_STATUS 
BMIWriteMemory(HIF_DEVICE *device, 
               A_UINT32 address, 
               A_UCHAR *buffer, 
               A_UINT32 length) 
{
    A_UINT32 cid;
    A_STATUS status;
    A_UINT32 offset;
    A_UINT32 remaining, txlen;
    A_UCHAR data[BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length)];
	A_UINT32 header=sizeof(cid) + sizeof(address) + sizeof(length);

    if (bmiDone) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Command disallowed\n");
        return A_ERROR;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,
         "BMI Write Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n", 
          device, address, length);

    cid = BMI_WRITE_MEMORY;

#ifdef ONLY_16BIT
    length = length + (length % 2);
#endif
    remaining = length;
    while (remaining)
    {
        txlen = (remaining < (BMI_DATASZ_MAX - header)) ? 
                                       remaining : (BMI_DATASZ_MAX - header);
        offset = 0;
        A_MEMCPY(&data[offset], &cid, sizeof(cid));
        offset += sizeof(cid);
        A_MEMCPY(&data[offset], &address, sizeof(address));
        offset += sizeof(address);
        A_MEMCPY(&data[offset], &txlen, sizeof(txlen));
        offset += sizeof(txlen);
        A_MEMCPY(&data[offset], &buffer[length - remaining], txlen);
        offset += txlen;
        status = bmiBufferSend(device, data, offset);
        if (status != A_OK) {
            BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to write to the device\n");
            return A_ERROR;
        }
        remaining -= txlen; address += txlen;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,"BMI Write Memory: Exit\n");

    return A_OK;
}

A_STATUS 
BMIExecute(HIF_DEVICE *device, 
           A_UINT32 address, 
           A_UINT32 *param) 
{
    A_UINT32 cid;
    A_STATUS status;
    A_UINT32 offset;
    A_UCHAR data[sizeof(cid) + sizeof(address) + sizeof(*param)];

    if (bmiDone) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Command disallowed\n");
        return A_ERROR;
    }

    BMI_DEBUG_PRINTF(ATH_LOG_INF,
       "BMI Execute: Enter (device: 0x%p, address: 0x%x, param: %d)\n", 
        device, address, *param);

    cid = BMI_EXECUTE;

    offset = 0;
    A_MEMCPY(&data[offset], &cid, sizeof(cid));
    offset += sizeof(cid);
    A_MEMCPY(&data[offset], &address, sizeof(address));
    offset += sizeof(address);
    A_MEMCPY(&data[offset], param, sizeof(*param));
    offset += sizeof(*param);
    status = bmiBufferSend(device, data, offset);
    if (status != A_OK) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to write to the device\n");
        return A_ERROR;
    }

    status = bmiBufferReceive(device, data, sizeof(*param));
    if (status != A_OK) {
        BMI_DEBUG_PRINTF(ATH_LOG_ERR,"Unable to read from the device\n");
        return A_ERROR;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产伦精品一区二区三区免费迷| 欧美一区二区三区婷婷月色 | 国产精品一线二线三线精华| 日韩一区二区三区在线观看| 麻豆91在线播放| 久久亚洲私人国产精品va媚药| 精品亚洲成a人在线观看| 26uuuu精品一区二区| www.爱久久.com| 亚洲乱码国产乱码精品精可以看| 欧美视频在线一区| 日韩高清在线电影| 久久蜜桃av一区二区天堂| 成人精品电影在线观看| 亚洲精品视频免费看| 91精品国产品国语在线不卡| 国产一区二区三区免费看| 欧美激情一区在线观看| 色偷偷88欧美精品久久久| 日韩极品在线观看| 国产女人18水真多18精品一级做| 色欧美乱欧美15图片| 美女视频黄免费的久久| 亚洲欧洲性图库| 欧美一区二区三区影视| 成人av片在线观看| 日韩和欧美一区二区三区| 日韩一区二区不卡| 自拍av一区二区三区| 91原创在线视频| 亚洲视频1区2区| 91老司机福利 在线| 亚洲欧美日韩系列| 91黄色在线观看| 亚洲福利视频一区| 欧美三级资源在线| 图片区小说区区亚洲影院| 欧美精品xxxxbbbb| 日本人妖一区二区| 精品国产乱码久久久久久蜜臀 | 亚洲一区av在线| 欧美性生活久久| 三级一区在线视频先锋| 3atv在线一区二区三区| 九一久久久久久| 久久久久久黄色| 99re亚洲国产精品| 亚洲一区二区三区在线| 欧美一级片在线看| 国产伦精品一区二区三区视频青涩| 国产婷婷色一区二区三区| 成人av网站大全| 偷拍日韩校园综合在线| 精品福利在线导航| 国产91精品一区二区| 最新国产の精品合集bt伙计| 在线观看亚洲精品| 日本午夜一本久久久综合| 久久综合狠狠综合久久激情| 国产福利视频一区二区三区| 国产精品美女久久久久久久| 不卡一区中文字幕| 精久久久久久久久久久| 日韩高清中文字幕一区| 日韩精品电影在线| 日韩综合小视频| 天堂成人免费av电影一区| 亚洲资源中文字幕| 亚洲精品视频免费观看| 一区二区三区免费观看| 亚洲精品中文在线影院| 亚洲免费观看高清完整版在线观看 | 日韩国产精品久久久久久亚洲| 亚洲国产美女搞黄色| 一区二区三区成人| 一区av在线播放| 亚洲高清不卡在线| 久久91精品久久久久久秒播| 偷拍一区二区三区四区| 肉色丝袜一区二区| 青青草伊人久久| 麻豆精品视频在线观看免费| 久久激情五月激情| 韩国成人福利片在线播放| 国产麻豆91精品| 国产成人亚洲精品青草天美| 粉嫩av亚洲一区二区图片| 国产成人av电影在线观看| 国产精品影视在线观看| 成人av网站在线观看免费| 国产999精品久久久久久| aaa欧美色吧激情视频| 日本道在线观看一区二区| 欧美午夜电影网| 欧美日韩你懂的| 欧美日韩视频在线观看一区二区三区 | 免费人成在线不卡| 久久国产精品72免费观看| 国产成人在线免费| 91麻豆精东视频| 91 com成人网| 国产午夜精品久久| 亚洲视频一区在线观看| 日韩高清在线不卡| 国产福利精品导航| 色婷婷香蕉在线一区二区| 欧美日韩一级视频| 久久先锋影音av鲁色资源| 国产精品福利av| 亚洲18色成人| 国产xxx精品视频大全| 在线国产亚洲欧美| 欧美成人性福生活免费看| 国产精品美女久久久久aⅴ国产馆| 亚洲日韩欧美一区二区在线| 日韩影院精彩在线| 豆国产96在线|亚洲| 欧美视频一区二区三区四区| 精品日韩一区二区三区免费视频| 亚洲欧洲一区二区在线播放| 久久草av在线| 在线看国产一区| 精品国产91乱码一区二区三区 | 日韩中文字幕区一区有砖一区 | 91丨porny丨户外露出| 在线电影欧美成精品| 国产精品福利影院| 久久国产免费看| 欧美日韩美少妇| 亚洲色图色小说| 国产一区二区三区观看| 日韩一区二区免费在线电影| 一区二区三区资源| 国产成人亚洲综合a∨婷婷| 欧美剧在线免费观看网站| 国产精品久久久久久户外露出 | 粗大黑人巨茎大战欧美成人| 91精品久久久久久久91蜜桃| 亚洲欧美日韩电影| 国产成人精品一区二| 日韩欧美一区二区视频| 亚洲一区二区在线免费观看视频| 国产精品77777| 日韩欧美卡一卡二| 亚洲va韩国va欧美va精品| 99精品1区2区| 国产精品二三区| 国产成人超碰人人澡人人澡| 欧美成人精品二区三区99精品| 亚洲午夜影视影院在线观看| 91热门视频在线观看| 欧美国产精品久久| 国产黑丝在线一区二区三区| 精品久久久久香蕉网| 久久国产精品区| 欧美一区二区三区免费视频| 午夜精品久久久| 欧美精品亚洲一区二区在线播放| 亚洲女与黑人做爰| 91麻豆国产香蕉久久精品| 国产精品久久久久三级| 成人一级片网址| 国产精品盗摄一区二区三区| 成人黄色软件下载| 国产精品久久久久久久久免费桃花| 丁香桃色午夜亚洲一区二区三区| 久久久久国产一区二区三区四区| 国精产品一区一区三区mba桃花 | 久久福利资源站| 国产亚洲欧美中文| 国产成人小视频| 国产精品久久久久久久久免费桃花| 99久久婷婷国产精品综合| 中文字幕制服丝袜一区二区三区 | 亚洲h动漫在线| 717成人午夜免费福利电影| 三级亚洲高清视频| 日韩精品在线网站| 韩国欧美国产1区| 亚洲国产精品成人久久综合一区| 成人一区在线观看| 亚洲欧美在线视频| 欧美三级欧美一级| 蜜桃视频第一区免费观看| 精品国产在天天线2019| 国产精品一区二区在线观看不卡| 国产精品色在线观看| 色婷婷香蕉在线一区二区| 日韩和欧美的一区| 国产女同性恋一区二区| 色av成人天堂桃色av| 日本欧美韩国一区三区| 久久你懂得1024| 色婷婷综合久久久久中文一区二区 | 国产成人午夜片在线观看高清观看| 欧美国产国产综合| 欧美在线视频日韩| 麻豆免费精品视频| 中文字幕视频一区| 91麻豆精品国产91久久久资源速度|