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

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

?? bmi.c

?? Linux下SDIO設備的驅動程序
?? C
字號:
/* * Copyright (c) 2004-2006 Atheros Communications Inc. *  Wireless Network driver for Atheros AR6001 * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License version 2 as *  published by the Free Software Foundation; * *  Software distributed under the License is distributed on an "AS *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *  implied. See the License for the specific language governing *  rights and limitations under the License. * * * This file contains the routines that implement the Boot loader messaging * interface */#include "../include/hif.h"#include "../include/bmi.h"#include "../include/htc.h"#include "bmi_internal.h"/*Although we had envisioned BMI to run on top of HTC, this is not what thefinal implementation boiled down to on dragon. Its a part of BSP and doesnot use the HTC protocol either. On the host side, however, we were stillliving with the original idea. I think the time has come to accept the truthand 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;extern A_UINT32 debugbmi;#ifdef DEBUG#define AR_DEBUG_PRINTF(...)        if (debugbmi) A_PRINTF(__VA_ARGS__);#else#define AR_DEBUG_PRINTF(...)#endif/* APIs visible to the driver */voidBMIInit(void){    bmiDone = FALSE;}A_STATUSBMIDone(HIF_DEVICE *device){    A_STATUS status;    A_UINT32 cid;    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("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) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("BMI Done: Exit\n");    return A_OK;}A_STATUSBMIGetTargetId(HIF_DEVICE *device, A_UINT32 *id){    A_STATUS status;    A_UINT32 cid;    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("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) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    status = bmiBufferReceive(device, (A_UCHAR *)id, sizeof(*id));    if (status != A_OK) {        AR_DEBUG_PRINTF("Unable to read from the device\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("BMI Get Target ID: Exit (ID: 0x%x)\n", *id);    return A_OK;}A_STATUSBMIReadMemory(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;    const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(length);    A_UCHAR data[BMI_DATASZ_MAX + header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(       "BMI Read Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n",        device, address, length);    cid = BMI_READ_MEMORY;    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) {            AR_DEBUG_PRINTF("Unable to write to the device\n");            return A_ERROR;        }        status = bmiBufferReceive(device, data, rxlen);        if (status != A_OK) {            AR_DEBUG_PRINTF("Unable to read from the device\n");            return A_ERROR;        }        A_MEMCPY(&buffer[length - remaining], data, rxlen);        remaining -= rxlen; address += rxlen;    }    AR_DEBUG_PRINTF("BMI Read Memory: Exit\n");    return A_OK;}A_STATUSBMIWriteMemory(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;    const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(length);    A_UCHAR data[BMI_DATASZ_MAX + header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(         "BMI Write Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n",          device, address, length);    cid = BMI_WRITE_MEMORY;    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) {            AR_DEBUG_PRINTF("Unable to write to the device\n");            return A_ERROR;        }        remaining -= txlen; address += txlen;    }    AR_DEBUG_PRINTF("BMI Write Memory: Exit\n");    return A_OK;}A_STATUSBMIExecute(HIF_DEVICE *device,           A_UINT32 address,           A_UINT32 *param){    A_UINT32 cid;    A_STATUS status;    A_UINT32 offset;    const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(*param);    A_UCHAR data[header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(       "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) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    status = bmiBufferReceive(device, data, sizeof(*param));    if (status != A_OK) {        AR_DEBUG_PRINTF("Unable to read from the device\n");        return A_ERROR;    }    A_MEMCPY(param, data, sizeof(*param));    AR_DEBUG_PRINTF("BMI Execute: Exit (param: %d)\n", *param);    return A_OK;}A_STATUSBMISetAppStart(HIF_DEVICE *device,               A_UINT32 address){    A_UINT32 cid;    A_STATUS status;    A_UINT32 offset;    const A_UINT32 header = sizeof(cid) + sizeof(address);    A_UCHAR data[header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(       "BMI Set App Start: Enter (device: 0x%p, address: 0x%x)\n",        device, address);    cid = BMI_SET_APP_START;    offset = 0;    A_MEMCPY(&data[offset], &cid, sizeof(cid));    offset += sizeof(cid);    A_MEMCPY(&data[offset], &address, sizeof(address));    offset += sizeof(address);    status = bmiBufferSend(device, data, offset);    if (status != A_OK) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("BMI Set App Start: Exit\n");    return A_OK;}A_STATUSBMIReadSOCRegister(HIF_DEVICE *device,                   A_UINT32 address,                   A_UINT32 *param){    A_UINT32 cid;    A_STATUS status;    A_UINT32 offset;    const A_UINT32 header = sizeof(cid) + sizeof(address);    A_UCHAR data[header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(       "BMI Read SOC Register: Enter (device: 0x%p, address: 0x%x)\n",        device, address);    cid = BMI_READ_SOC_REGISTER;    offset = 0;    A_MEMCPY(&data[offset], &cid, sizeof(cid));    offset += sizeof(cid);    A_MEMCPY(&data[offset], &address, sizeof(address));    offset += sizeof(address);    status = bmiBufferSend(device, data, offset);    if (status != A_OK) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    status = bmiBufferReceive(device, data, sizeof(*param));    if (status != A_OK) {        AR_DEBUG_PRINTF("Unable to read from the device\n");        return A_ERROR;    }    A_MEMCPY(param, data, sizeof(*param));    AR_DEBUG_PRINTF("BMI Read SOC Register: Exit (value: %d)\n", *param);    return A_OK;}A_STATUSBMIWriteSOCRegister(HIF_DEVICE *device,                    A_UINT32 address,                    A_UINT32 param){    A_UINT32 cid;    A_STATUS status;    A_UINT32 offset;    const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(param);    A_UCHAR data[header];    if (bmiDone) {        AR_DEBUG_PRINTF("Command disallowed\n");        return A_ERROR;    }    AR_DEBUG_PRINTF(     "BMI Write SOC Register: Enter (device: 0x%p, address: 0x%x, param: %d)\n",      device, address, param);    cid = BMI_WRITE_SOC_REGISTER;    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) {        AR_DEBUG_PRINTF("Unable to write to the device\n");        return A_ERROR;    }    AR_DEBUG_PRINTF("BMI Read SOC Register: Exit\n");    return A_OK;}/* BMI Access routines */A_STATUSbmiBufferSend(HIF_DEVICE *device,              A_UCHAR *buffer,              A_UINT32 length){    A_STATUS status;    A_UINT32 timeout;    A_UINT32 address;    A_UCHAR cmdCredits;    HIF_REQUEST request;    A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX];    HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR,                       &mboxAddress, sizeof(mboxAddress));    cmdCredits = 0;    timeout = BMI_COMMUNICATION_TIMEOUT;    while(timeout-- && !cmdCredits) {        /* Read the counter register to get the command credits */        HIF_FRAME_REQUEST(&request, HIF_READ, HIF_EXTENDED_IO, HIF_SYNCHRONOUS,                          HIF_BYTE_BASIS, HIF_FIXED_ADDRESS);        address = COUNT_DEC_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 4;        status = HIFReadWrite(device, address, &cmdCredits, 1,                              &request, NULL);        if (status != A_OK) {            AR_DEBUG_PRINTF("Unable to decrement the command credit count register\n");            return A_ERROR;        }    }    if (cmdCredits) {        HIF_FRAME_REQUEST(&request, HIF_WRITE, HIF_EXTENDED_IO,                              HIF_SYNCHRONOUS, HIF_BYTE_BASIS,                              HIF_INCREMENTAL_ADDRESS);        address = mboxAddress[ENDPOINT1];        status = HIFReadWrite(device, address, buffer, length, &request, NULL);        if (status != A_OK) {            AR_DEBUG_PRINTF("Unable to send the BMI data to the device\n");            return A_ERROR;        }    } else {        AR_DEBUG_PRINTF("BMI Communication timeout\n");        return A_ERROR;    }    return status;}A_STATUSbmiBufferReceive(HIF_DEVICE *device,                 A_UCHAR *buffer,                 A_UINT32 length){    A_STATUS status;    A_UINT32 address;    A_UINT32 timeout;    A_UCHAR cmdCredits;    HIF_REQUEST request;    A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX];    HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR,                       &mboxAddress, sizeof(mboxAddress));    cmdCredits = 0;    timeout = BMI_COMMUNICATION_TIMEOUT;    while(timeout-- && !cmdCredits) {        /* Read the counter register to get the command credits */        HIF_FRAME_REQUEST(&request, HIF_READ, HIF_EXTENDED_IO, HIF_SYNCHRONOUS,                          HIF_BYTE_BASIS, HIF_FIXED_ADDRESS);        address = COUNT_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 1;        status = HIFReadWrite(device, address, &cmdCredits, sizeof(cmdCredits),                              &request, NULL);        if (status != A_OK) {            AR_DEBUG_PRINTF("Unable to decrement the command credit count register\n");            return A_ERROR;        }        status = A_ERROR;    }    if (cmdCredits) {        HIF_FRAME_REQUEST(&request, HIF_READ, HIF_EXTENDED_IO,                          HIF_SYNCHRONOUS, HIF_BYTE_BASIS,                          HIF_INCREMENTAL_ADDRESS);        address = mboxAddress[ENDPOINT1];        status = HIFReadWrite(device, address, buffer, length, &request, NULL);        if (status != A_OK) {            AR_DEBUG_PRINTF("Unable to read the BMI data from the device\n");            return A_ERROR;        }    } else {        AR_DEBUG_PRINTF("BMI Communication timeout\n");        return A_ERROR;    }    return status;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丁香婷婷深情五月亚洲| 7777精品久久久大香线蕉 | 国产亚洲一区字幕| 久久综合色8888| 国产午夜亚洲精品午夜鲁丝片 | 无码av免费一区二区三区试看| 国产精品久久久久久久第一福利| 国产精品美女一区二区| 国产精品传媒在线| 亚洲一区二区三区影院| 天堂va蜜桃一区二区三区| 日本成人在线不卡视频| 麻豆精品在线看| 国产激情一区二区三区| 一区二区三区四区激情| 日韩精品一二三四| 国产一区二区三区四| 亚洲v日本v欧美v久久精品| 免费成人在线播放| 成人黄色在线视频| 91麻豆精品国产91久久久使用方法 | 欧美日韩免费一区二区三区| 精品免费国产二区三区| 欧美日韩不卡在线| 久久网站热最新地址| 性做久久久久久久免费看| av在线不卡免费看| 精品国产一区久久| 日日夜夜一区二区| 91国偷自产一区二区三区观看| 久久夜色精品国产欧美乱极品| 亚洲影院久久精品| www.成人网.com| 国产精品天干天干在观线| 日韩av高清在线观看| 欧美日韩高清一区| 亚洲国产视频网站| 9久草视频在线视频精品| 日本一区二区三区四区| 国产乱人伦偷精品视频免下载 | 亚洲免费伊人电影| eeuss鲁片一区二区三区在线看| 2020国产成人综合网| 久久精品国产成人一区二区三区| 欧美精品丝袜久久久中文字幕| 亚洲综合偷拍欧美一区色| 欧美性猛交xxxx黑人交| 一本久道中文字幕精品亚洲嫩| 国产精品久线观看视频| 成人天堂资源www在线| 91丨porny丨在线| 日本一区二区三区四区| 亚洲不卡av一区二区三区| 777久久久精品| 国产麻豆日韩欧美久久| 久久久九九九九| www.久久精品| 免费欧美在线视频| 亚洲私人影院在线观看| 欧美精品99久久久**| 久久成人综合网| 亚洲欧美一区二区三区国产精品 | 欧美男人的天堂一二区| 国内精品在线播放| 亚洲午夜免费福利视频| 欧美tk丨vk视频| 欧日韩精品视频| 狠狠色2019综合网| 视频一区在线播放| 国产精品二三区| 精品va天堂亚洲国产| 91高清视频在线| 国产成人免费视频一区| 亚洲国产wwwccc36天堂| 欧美极品另类videosde| 日韩一区二区三区高清免费看看| 99re成人精品视频| 国产高清成人在线| 蜜桃av一区二区在线观看| 一区二区国产盗摄色噜噜| 国产亚洲欧美一区在线观看| 欧美人与禽zozo性伦| 91色乱码一区二区三区| 成人精品国产福利| 成人av在线观| 99久久99久久精品国产片果冻| 国产美女主播视频一区| 亚洲一区二区成人在线观看| 亚洲欧美电影院| 欧美国产日本视频| 国产日韩欧美激情| 成人高清免费在线播放| 国产91精品在线观看| 久久综合综合久久综合| 亚洲精品亚洲人成人网在线播放| 91麻豆免费视频| 欧美在线视频不卡| 欧美一区二区三区在线| 久久久噜噜噜久久中文字幕色伊伊| 欧美揉bbbbb揉bbbbb| 精品国产乱码久久久久久影片| 欧美精品一区二区三区蜜桃 | 久久免费电影网| 国产日韩欧美不卡| 成人av网站免费观看| 欧美日韩免费观看一区三区| 欧美一级二级三级乱码| 国产午夜精品一区二区三区嫩草| 亚洲日本欧美天堂| 奇米色777欧美一区二区| 成人黄页在线观看| 精品一区二区国语对白| 色88888久久久久久影院野外| 在线观看91av| 久久久久久99精品| 亚洲电影一区二区三区| 国产一区二区主播在线| 欧美日韩国产另类一区| 丁香天五香天堂综合| 欧美猛男男办公室激情| 中文字幕亚洲综合久久菠萝蜜| 麻豆精品一区二区av白丝在线| 91免费在线视频观看| 国产精品全国免费观看高清| 日韩激情视频在线观看| 亚洲va欧美va人人爽| 一本色道久久加勒比精品 | 国产高清成人在线| 久久综合色8888| 天天操天天干天天综合网| 91高清视频免费看| 色综合婷婷久久| 国产精品视频麻豆| 国产精品18久久久久久久久久久久| 欧美成人三级电影在线| 男男成人高潮片免费网站| 欧美日韩国产首页| 久久精品国产999大香线蕉| 欧美三级电影在线看| 欧美成人一区二区三区片免费| 日韩电影在线看| 欧美大片一区二区| 国产麻豆视频一区二区| 久久精品夜夜夜夜久久| 91女厕偷拍女厕偷拍高清| 夜色激情一区二区| 欧美日韩不卡一区二区| 欧美电影免费观看高清完整版在线| 日韩精品高清不卡| 国产人成亚洲第一网站在线播放| 99久久99久久综合| 日本不卡在线视频| 中文字幕巨乱亚洲| 717成人午夜免费福利电影| 国产一区二区三区在线观看免费 | 亚洲制服丝袜av| 精品久久人人做人人爽| 91视频在线看| 激情综合网av| 亚洲国产精品影院| 国产精品欧美久久久久无广告| 欧美日韩精品一区二区在线播放| 美女视频网站久久| 亚洲成人一区二区在线观看| 欧美精品一区二区三区高清aⅴ| 国产一区二区剧情av在线| 亚洲欧美怡红院| 日韩三级精品电影久久久 | 最好看的中文字幕久久| 日韩三级视频在线看| 欧美日韩精品一区二区三区蜜桃 | 国产精品88888| 狠狠色丁香久久婷婷综合丁香| 欧美日韩精品欧美日韩精品一 | 日韩精品一区二区三区三区免费| 91理论电影在线观看| 国产麻豆视频精品| 国产91综合网| 中文字幕一区二区三区四区不卡| 2014亚洲片线观看视频免费| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 1024成人网| 一区二区三区四区在线免费观看| 成人黄页在线观看| 丰满亚洲少妇av| 精品夜夜嗨av一区二区三区| 久久se这里有精品| 国产成人在线影院| 成人av电影免费在线播放| eeuss鲁一区二区三区| jlzzjlzz亚洲女人18| 欧美在线观看视频一区二区 | 中文字幕人成不卡一区| 国产欧美精品一区| 国产精品久久久久久久久久久免费看| 国产精品视频线看| 国产性天天综合网| 一区二区免费看| 成人综合在线网站| 久久夜色精品国产噜噜av|