Staging: bcm: Bcmchar.c: Renamed variable "Adapter" -> "ad"
Renamed variable "Adapter" -> "ad" in bcm_handle_nvm_read_cmd() handle_flash2x_adapter() bcm_char_open() bcm_char_release() bcm_char_read() bcm_char_ioctl_reg_read_private() bcm_char_ioctl_reg_write_private() bcm_char_ioctl_reg_write_private() bcm_char_ioctl_eeprom_reg_read() bcm_char_ioctl_gpio_set_request() Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bf8fa21cb7
commit
5a7add1cc7
@ -2,29 +2,29 @@
|
|||||||
|
|
||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
|
|
||||||
static int bcm_handle_nvm_read_cmd(struct bcm_mini_adapter *Adapter,
|
static int bcm_handle_nvm_read_cmd(struct bcm_mini_adapter *ad,
|
||||||
PUCHAR pReadData,
|
PUCHAR pReadData,
|
||||||
struct bcm_nvm_readwrite *stNVMReadWrite)
|
struct bcm_nvm_readwrite *stNVMReadWrite)
|
||||||
{
|
{
|
||||||
INT Status = STATUS_FAILURE;
|
INT Status = STATUS_FAILURE;
|
||||||
|
|
||||||
down(&Adapter->NVMRdmWrmLock);
|
down(&ad->NVMRdmWrmLock);
|
||||||
|
|
||||||
if ((Adapter->IdleMode == TRUE) || (Adapter->bShutStatus == TRUE) ||
|
if ((ad->IdleMode == TRUE) || (ad->bShutStatus == TRUE) ||
|
||||||
(Adapter->bPreparingForLowPowerMode == TRUE)) {
|
(ad->bPreparingForLowPowerMode == TRUE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter,
|
BCM_DEBUG_PRINT(ad,
|
||||||
DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Device is in Idle/Shutdown Mode\n");
|
"Device is in Idle/Shutdown Mode\n");
|
||||||
up(&Adapter->NVMRdmWrmLock);
|
up(&ad->NVMRdmWrmLock);
|
||||||
kfree(pReadData);
|
kfree(pReadData);
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = BeceemNVMRead(Adapter, (PUINT)pReadData,
|
Status = BeceemNVMRead(ad, (PUINT)pReadData,
|
||||||
stNVMReadWrite->uiOffset,
|
stNVMReadWrite->uiOffset,
|
||||||
stNVMReadWrite->uiNumBytes);
|
stNVMReadWrite->uiNumBytes);
|
||||||
up(&Adapter->NVMRdmWrmLock);
|
up(&ad->NVMRdmWrmLock);
|
||||||
|
|
||||||
if (Status != STATUS_SUCCESS) {
|
if (Status != STATUS_SUCCESS) {
|
||||||
kfree(pReadData);
|
kfree(pReadData);
|
||||||
@ -40,7 +40,7 @@ static int bcm_handle_nvm_read_cmd(struct bcm_mini_adapter *Adapter,
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_flash2x_adapter(struct bcm_mini_adapter *Adapter,
|
static int handle_flash2x_adapter(struct bcm_mini_adapter *ad,
|
||||||
PUCHAR pReadData,
|
PUCHAR pReadData,
|
||||||
struct bcm_nvm_readwrite *stNVMReadWrite)
|
struct bcm_nvm_readwrite *stNVMReadWrite)
|
||||||
{
|
{
|
||||||
@ -62,17 +62,17 @@ static int handle_flash2x_adapter(struct bcm_mini_adapter *Adapter,
|
|||||||
INT Status;
|
INT Status;
|
||||||
ULONG ulDSDMagicNumInUsrBuff = 0;
|
ULONG ulDSDMagicNumInUsrBuff = 0;
|
||||||
|
|
||||||
Status = BcmFlash2xCorruptSig(Adapter, Adapter->eActiveDSD);
|
Status = BcmFlash2xCorruptSig(ad, ad->eActiveDSD);
|
||||||
if (Status == STATUS_SUCCESS)
|
if (Status == STATUS_SUCCESS)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
if (((stNVMReadWrite->uiOffset + stNVMReadWrite->uiNumBytes) !=
|
if (((stNVMReadWrite->uiOffset + stNVMReadWrite->uiNumBytes) !=
|
||||||
Adapter->uiNVMDSDSize) ||
|
ad->uiNVMDSDSize) ||
|
||||||
(stNVMReadWrite->uiNumBytes < SIGNATURE_SIZE)) {
|
(stNVMReadWrite->uiNumBytes < SIGNATURE_SIZE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"DSD Sig is present neither in Flash nor User provided Input..");
|
"DSD Sig is present neither in Flash nor User provided Input..");
|
||||||
up(&Adapter->NVMRdmWrmLock);
|
up(&ad->NVMRdmWrmLock);
|
||||||
kfree(pReadData);
|
kfree(pReadData);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -81,9 +81,9 @@ static int handle_flash2x_adapter(struct bcm_mini_adapter *Adapter,
|
|||||||
ntohl(*(PUINT)(pReadData + stNVMReadWrite->uiNumBytes -
|
ntohl(*(PUINT)(pReadData + stNVMReadWrite->uiNumBytes -
|
||||||
SIGNATURE_SIZE));
|
SIGNATURE_SIZE));
|
||||||
if (ulDSDMagicNumInUsrBuff != DSD_IMAGE_MAGIC_NUMBER) {
|
if (ulDSDMagicNumInUsrBuff != DSD_IMAGE_MAGIC_NUMBER) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"DSD Sig is present neither in Flash nor User provided Input..");
|
"DSD Sig is present neither in Flash nor User provided Input..");
|
||||||
up(&Adapter->NVMRdmWrmLock);
|
up(&ad->NVMRdmWrmLock);
|
||||||
kfree(pReadData);
|
kfree(pReadData);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -105,27 +105,27 @@ static int handle_flash2x_adapter(struct bcm_mini_adapter *Adapter,
|
|||||||
|
|
||||||
static int bcm_char_open(struct inode *inode, struct file *filp)
|
static int bcm_char_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
struct bcm_mini_adapter *Adapter = NULL;
|
struct bcm_mini_adapter *ad = NULL;
|
||||||
struct bcm_tarang_data *pTarang = NULL;
|
struct bcm_tarang_data *pTarang = NULL;
|
||||||
|
|
||||||
Adapter = GET_BCM_ADAPTER(gblpnetdev);
|
ad = GET_BCM_ADAPTER(gblpnetdev);
|
||||||
pTarang = kzalloc(sizeof(struct bcm_tarang_data), GFP_KERNEL);
|
pTarang = kzalloc(sizeof(struct bcm_tarang_data), GFP_KERNEL);
|
||||||
if (!pTarang)
|
if (!pTarang)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pTarang->Adapter = Adapter;
|
pTarang->Adapter = ad;
|
||||||
pTarang->RxCntrlMsgBitMask = 0xFFFFFFFF & ~(1 << 0xB);
|
pTarang->RxCntrlMsgBitMask = 0xFFFFFFFF & ~(1 << 0xB);
|
||||||
|
|
||||||
down(&Adapter->RxAppControlQueuelock);
|
down(&ad->RxAppControlQueuelock);
|
||||||
pTarang->next = Adapter->pTarangs;
|
pTarang->next = ad->pTarangs;
|
||||||
Adapter->pTarangs = pTarang;
|
ad->pTarangs = pTarang;
|
||||||
up(&Adapter->RxAppControlQueuelock);
|
up(&ad->RxAppControlQueuelock);
|
||||||
|
|
||||||
/* Store the Adapter structure */
|
/* Store the Adapter structure */
|
||||||
filp->private_data = pTarang;
|
filp->private_data = pTarang;
|
||||||
|
|
||||||
/* Start Queuing the control response Packets */
|
/* Start Queuing the control response Packets */
|
||||||
atomic_inc(&Adapter->ApplicationRunning);
|
atomic_inc(&ad->ApplicationRunning);
|
||||||
|
|
||||||
nonseekable_open(inode, filp);
|
nonseekable_open(inode, filp);
|
||||||
return 0;
|
return 0;
|
||||||
@ -134,7 +134,7 @@ static int bcm_char_open(struct inode *inode, struct file *filp)
|
|||||||
static int bcm_char_release(struct inode *inode, struct file *filp)
|
static int bcm_char_release(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
struct bcm_tarang_data *pTarang, *tmp, *ptmp;
|
struct bcm_tarang_data *pTarang, *tmp, *ptmp;
|
||||||
struct bcm_mini_adapter *Adapter = NULL;
|
struct bcm_mini_adapter *ad = NULL;
|
||||||
struct sk_buff *pkt, *npkt;
|
struct sk_buff *pkt, *npkt;
|
||||||
|
|
||||||
pTarang = (struct bcm_tarang_data *)filp->private_data;
|
pTarang = (struct bcm_tarang_data *)filp->private_data;
|
||||||
@ -142,11 +142,11 @@ static int bcm_char_release(struct inode *inode, struct file *filp)
|
|||||||
if (pTarang == NULL)
|
if (pTarang == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Adapter = pTarang->Adapter;
|
ad = pTarang->Adapter;
|
||||||
|
|
||||||
down(&Adapter->RxAppControlQueuelock);
|
down(&ad->RxAppControlQueuelock);
|
||||||
|
|
||||||
tmp = Adapter->pTarangs;
|
tmp = ad->pTarangs;
|
||||||
for (ptmp = NULL; tmp; ptmp = tmp, tmp = tmp->next) {
|
for (ptmp = NULL; tmp; ptmp = tmp, tmp = tmp->next) {
|
||||||
if (tmp == pTarang)
|
if (tmp == pTarang)
|
||||||
break;
|
break;
|
||||||
@ -154,11 +154,11 @@ static int bcm_char_release(struct inode *inode, struct file *filp)
|
|||||||
|
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
if (!ptmp)
|
if (!ptmp)
|
||||||
Adapter->pTarangs = tmp->next;
|
ad->pTarangs = tmp->next;
|
||||||
else
|
else
|
||||||
ptmp->next = tmp->next;
|
ptmp->next = tmp->next;
|
||||||
} else {
|
} else {
|
||||||
up(&Adapter->RxAppControlQueuelock);
|
up(&ad->RxAppControlQueuelock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,10 +169,10 @@ static int bcm_char_release(struct inode *inode, struct file *filp)
|
|||||||
pkt = npkt;
|
pkt = npkt;
|
||||||
}
|
}
|
||||||
|
|
||||||
up(&Adapter->RxAppControlQueuelock);
|
up(&ad->RxAppControlQueuelock);
|
||||||
|
|
||||||
/* Stop Queuing the control response Packets */
|
/* Stop Queuing the control response Packets */
|
||||||
atomic_dec(&Adapter->ApplicationRunning);
|
atomic_dec(&ad->ApplicationRunning);
|
||||||
|
|
||||||
kfree(pTarang);
|
kfree(pTarang);
|
||||||
|
|
||||||
@ -187,33 +187,33 @@ static ssize_t bcm_char_read(struct file *filp,
|
|||||||
loff_t *f_pos)
|
loff_t *f_pos)
|
||||||
{
|
{
|
||||||
struct bcm_tarang_data *pTarang = filp->private_data;
|
struct bcm_tarang_data *pTarang = filp->private_data;
|
||||||
struct bcm_mini_adapter *Adapter = pTarang->Adapter;
|
struct bcm_mini_adapter *ad = pTarang->Adapter;
|
||||||
struct sk_buff *Packet = NULL;
|
struct sk_buff *Packet = NULL;
|
||||||
ssize_t PktLen = 0;
|
ssize_t PktLen = 0;
|
||||||
int wait_ret_val = 0;
|
int wait_ret_val = 0;
|
||||||
unsigned long ret = 0;
|
unsigned long ret = 0;
|
||||||
|
|
||||||
wait_ret_val = wait_event_interruptible(
|
wait_ret_val = wait_event_interruptible(
|
||||||
Adapter->process_read_wait_queue,
|
ad->process_read_wait_queue,
|
||||||
(pTarang->RxAppControlHead ||
|
(pTarang->RxAppControlHead ||
|
||||||
Adapter->device_removed));
|
ad->device_removed));
|
||||||
|
|
||||||
if ((wait_ret_val == -ERESTARTSYS)) {
|
if ((wait_ret_val == -ERESTARTSYS)) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Exiting as i've been asked to exit!!!\n");
|
"Exiting as i've been asked to exit!!!\n");
|
||||||
return wait_ret_val;
|
return wait_ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Adapter->device_removed) {
|
if (ad->device_removed) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Device Removed... Killing the Apps...\n");
|
"Device Removed... Killing the Apps...\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false == Adapter->fw_download_done)
|
if (false == ad->fw_download_done)
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
||||||
down(&Adapter->RxAppControlQueuelock);
|
down(&ad->RxAppControlQueuelock);
|
||||||
|
|
||||||
if (pTarang->RxAppControlHead) {
|
if (pTarang->RxAppControlHead) {
|
||||||
Packet = pTarang->RxAppControlHead;
|
Packet = pTarang->RxAppControlHead;
|
||||||
@ -222,7 +222,7 @@ static ssize_t bcm_char_read(struct file *filp,
|
|||||||
pTarang->AppCtrlQueueLen--;
|
pTarang->AppCtrlQueueLen--;
|
||||||
}
|
}
|
||||||
|
|
||||||
up(&Adapter->RxAppControlQueuelock);
|
up(&ad->RxAppControlQueuelock);
|
||||||
|
|
||||||
if (Packet) {
|
if (Packet) {
|
||||||
PktLen = Packet->len;
|
PktLen = Packet->len;
|
||||||
@ -230,22 +230,22 @@ static ssize_t bcm_char_read(struct file *filp,
|
|||||||
min_t(size_t, PktLen, size));
|
min_t(size_t, PktLen, size));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_kfree_skb(Packet);
|
dev_kfree_skb(Packet);
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"Returning from copy to user failure\n");
|
"Returning from copy to user failure\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Read %zd Bytes From Adapter packet = %p by process %d!\n",
|
"Read %zd Bytes From Adapter packet = %p by process %d!\n",
|
||||||
PktLen, Packet, current->pid);
|
PktLen, Packet, current->pid);
|
||||||
dev_kfree_skb(Packet);
|
dev_kfree_skb(Packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "<\n");
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "<\n");
|
||||||
return PktLen;
|
return PktLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_char_ioctl_reg_read_private(void __user *argp,
|
static int bcm_char_ioctl_reg_read_private(void __user *argp,
|
||||||
struct bcm_mini_adapter *Adapter)
|
struct bcm_mini_adapter *ad)
|
||||||
{
|
{
|
||||||
struct bcm_rdm_buffer sRdmBuffer = {0};
|
struct bcm_rdm_buffer sRdmBuffer = {0};
|
||||||
struct bcm_ioctl_buffer IoBuffer;
|
struct bcm_ioctl_buffer IoBuffer;
|
||||||
@ -279,7 +279,7 @@ static int bcm_char_ioctl_reg_read_private(void __user *argp,
|
|||||||
if (!temp_buff)
|
if (!temp_buff)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
bytes = rdmalt(Adapter, (UINT)sRdmBuffer.Register,
|
bytes = rdmalt(ad, (UINT)sRdmBuffer.Register,
|
||||||
(PUINT)temp_buff, Bufflen);
|
(PUINT)temp_buff, Bufflen);
|
||||||
if (bytes > 0) {
|
if (bytes > 0) {
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
@ -296,7 +296,7 @@ static int bcm_char_ioctl_reg_read_private(void __user *argp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_char_ioctl_reg_write_private(void __user *argp,
|
static int bcm_char_ioctl_reg_write_private(void __user *argp,
|
||||||
struct bcm_mini_adapter *Adapter)
|
struct bcm_mini_adapter *ad)
|
||||||
{
|
{
|
||||||
struct bcm_wrm_buffer sWrmBuffer = {0};
|
struct bcm_wrm_buffer sWrmBuffer = {0};
|
||||||
struct bcm_ioctl_buffer IoBuffer;
|
struct bcm_ioctl_buffer IoBuffer;
|
||||||
@ -317,25 +317,25 @@ static int bcm_char_ioctl_reg_write_private(void __user *argp,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
uiTempVar = sWrmBuffer.Register & EEPROM_REJECT_MASK;
|
uiTempVar = sWrmBuffer.Register & EEPROM_REJECT_MASK;
|
||||||
if (!((Adapter->pstargetparams->m_u32Customize) & VSG_MODE) &&
|
if (!((ad->pstargetparams->m_u32Customize) & VSG_MODE) &&
|
||||||
((uiTempVar == EEPROM_REJECT_REG_1) ||
|
((uiTempVar == EEPROM_REJECT_REG_1) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_2) ||
|
(uiTempVar == EEPROM_REJECT_REG_2) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_3) ||
|
(uiTempVar == EEPROM_REJECT_REG_3) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_4))) {
|
(uiTempVar == EEPROM_REJECT_REG_4))) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"EEPROM Access Denied, not in VSG Mode\n");
|
"EEPROM Access Denied, not in VSG Mode\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = wrmalt(Adapter, (UINT)sWrmBuffer.Register,
|
Status = wrmalt(ad, (UINT)sWrmBuffer.Register,
|
||||||
(PUINT)sWrmBuffer.Data, sizeof(ULONG));
|
(PUINT)sWrmBuffer.Data, sizeof(ULONG));
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS) {
|
if (Status == STATUS_SUCCESS) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL, "WRM Done\n");
|
DBG_LVL_ALL, "WRM Done\n");
|
||||||
} else {
|
} else {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL, "WRM Failed\n");
|
DBG_LVL_ALL, "WRM Failed\n");
|
||||||
Status = -EFAULT;
|
Status = -EFAULT;
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ static int bcm_char_ioctl_reg_write_private(void __user *argp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
||||||
struct bcm_mini_adapter *Adapter)
|
struct bcm_mini_adapter *ad)
|
||||||
{
|
{
|
||||||
struct bcm_rdm_buffer sRdmBuffer = {0};
|
struct bcm_rdm_buffer sRdmBuffer = {0};
|
||||||
struct bcm_ioctl_buffer IoBuffer;
|
struct bcm_ioctl_buffer IoBuffer;
|
||||||
@ -352,11 +352,11 @@ static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
|||||||
INT Status;
|
INT Status;
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
if ((Adapter->IdleMode == TRUE) ||
|
if ((ad->IdleMode == TRUE) ||
|
||||||
(Adapter->bShutStatus == TRUE) ||
|
(ad->bShutStatus == TRUE) ||
|
||||||
(Adapter->bPreparingForLowPowerMode == TRUE)) {
|
(ad->bPreparingForLowPowerMode == TRUE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"Device in Idle Mode, Blocking Rdms\n");
|
"Device in Idle Mode, Blocking Rdms\n");
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
@ -384,7 +384,7 @@ static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
|||||||
if ((((ULONG)sRdmBuffer.Register & 0x0F000000) != 0x0F000000) ||
|
if ((((ULONG)sRdmBuffer.Register & 0x0F000000) != 0x0F000000) ||
|
||||||
((ULONG)sRdmBuffer.Register & 0x3)) {
|
((ULONG)sRdmBuffer.Register & 0x3)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"RDM Done On invalid Address : %x Access Denied.\n",
|
"RDM Done On invalid Address : %x Access Denied.\n",
|
||||||
(int)sRdmBuffer.Register);
|
(int)sRdmBuffer.Register);
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiTempVar = sRdmBuffer.Register & EEPROM_REJECT_MASK;
|
uiTempVar = sRdmBuffer.Register & EEPROM_REJECT_MASK;
|
||||||
bytes = rdmaltWithLock(Adapter, (UINT)sRdmBuffer.Register,
|
bytes = rdmaltWithLock(ad, (UINT)sRdmBuffer.Register,
|
||||||
(PUINT)temp_buff, IoBuffer.OutputLength);
|
(PUINT)temp_buff, IoBuffer.OutputLength);
|
||||||
|
|
||||||
if (bytes > 0) {
|
if (bytes > 0) {
|
||||||
@ -411,7 +411,7 @@ static int bcm_char_ioctl_eeprom_reg_read(void __user *argp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_char_ioctl_eeprom_reg_write(void __user *argp,
|
static int bcm_char_ioctl_eeprom_reg_write(void __user *argp,
|
||||||
struct bcm_mini_adapter *Adapter,
|
struct bcm_mini_adapter *ad,
|
||||||
UINT cmd)
|
UINT cmd)
|
||||||
{
|
{
|
||||||
struct bcm_wrm_buffer sWrmBuffer = {0};
|
struct bcm_wrm_buffer sWrmBuffer = {0};
|
||||||
@ -419,11 +419,11 @@ static int bcm_char_ioctl_eeprom_reg_write(void __user *argp,
|
|||||||
UINT uiTempVar = 0;
|
UINT uiTempVar = 0;
|
||||||
INT Status;
|
INT Status;
|
||||||
|
|
||||||
if ((Adapter->IdleMode == TRUE) ||
|
if ((ad->IdleMode == TRUE) ||
|
||||||
(Adapter->bShutStatus == TRUE) ||
|
(ad->bShutStatus == TRUE) ||
|
||||||
(Adapter->bPreparingForLowPowerMode == TRUE)) {
|
(ad->bPreparingForLowPowerMode == TRUE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"Device in Idle Mode, Blocking Wrms\n");
|
"Device in Idle Mode, Blocking Wrms\n");
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
@ -443,34 +443,34 @@ static int bcm_char_ioctl_eeprom_reg_write(void __user *argp,
|
|||||||
if ((((ULONG)sWrmBuffer.Register & 0x0F000000) != 0x0F000000) ||
|
if ((((ULONG)sWrmBuffer.Register & 0x0F000000) != 0x0F000000) ||
|
||||||
((ULONG)sWrmBuffer.Register & 0x3)) {
|
((ULONG)sWrmBuffer.Register & 0x3)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"WRM Done On invalid Address : %x Access Denied.\n",
|
"WRM Done On invalid Address : %x Access Denied.\n",
|
||||||
(int)sWrmBuffer.Register);
|
(int)sWrmBuffer.Register);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
uiTempVar = sWrmBuffer.Register & EEPROM_REJECT_MASK;
|
uiTempVar = sWrmBuffer.Register & EEPROM_REJECT_MASK;
|
||||||
if (!((Adapter->pstargetparams->m_u32Customize) & VSG_MODE) &&
|
if (!((ad->pstargetparams->m_u32Customize) & VSG_MODE) &&
|
||||||
((uiTempVar == EEPROM_REJECT_REG_1) ||
|
((uiTempVar == EEPROM_REJECT_REG_1) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_2) ||
|
(uiTempVar == EEPROM_REJECT_REG_2) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_3) ||
|
(uiTempVar == EEPROM_REJECT_REG_3) ||
|
||||||
(uiTempVar == EEPROM_REJECT_REG_4)) &&
|
(uiTempVar == EEPROM_REJECT_REG_4)) &&
|
||||||
(cmd == IOCTL_BCM_REGISTER_WRITE)) {
|
(cmd == IOCTL_BCM_REGISTER_WRITE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, 0, 0,
|
||||||
"EEPROM Access Denied, not in VSG Mode\n");
|
"EEPROM Access Denied, not in VSG Mode\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = wrmaltWithLock(Adapter, (UINT)sWrmBuffer.Register,
|
Status = wrmaltWithLock(ad, (UINT)sWrmBuffer.Register,
|
||||||
(PUINT)sWrmBuffer.Data,
|
(PUINT)sWrmBuffer.Data,
|
||||||
sWrmBuffer.Length);
|
sWrmBuffer.Length);
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS) {
|
if (Status == STATUS_SUCCESS) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_PRINTK, OSAL_DBG,
|
||||||
DBG_LVL_ALL, "WRM Done\n");
|
DBG_LVL_ALL, "WRM Done\n");
|
||||||
} else {
|
} else {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL, "WRM Failed\n");
|
DBG_LVL_ALL, "WRM Failed\n");
|
||||||
Status = -EFAULT;
|
Status = -EFAULT;
|
||||||
}
|
}
|
||||||
@ -478,7 +478,7 @@ static int bcm_char_ioctl_eeprom_reg_write(void __user *argp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
||||||
struct bcm_mini_adapter *Adapter)
|
struct bcm_mini_adapter *ad)
|
||||||
{
|
{
|
||||||
struct bcm_gpio_info gpio_info = {0};
|
struct bcm_gpio_info gpio_info = {0};
|
||||||
struct bcm_ioctl_buffer IoBuffer;
|
struct bcm_ioctl_buffer IoBuffer;
|
||||||
@ -489,11 +489,11 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
INT Status;
|
INT Status;
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
if ((Adapter->IdleMode == TRUE) ||
|
if ((ad->IdleMode == TRUE) ||
|
||||||
(Adapter->bShutStatus == TRUE) ||
|
(ad->bShutStatus == TRUE) ||
|
||||||
(Adapter->bPreparingForLowPowerMode == TRUE)) {
|
(ad->bPreparingForLowPowerMode == TRUE)) {
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL,
|
DBG_LVL_ALL,
|
||||||
"GPIO Can't be set/clear in Low power Mode");
|
"GPIO Can't be set/clear in Low power Mode");
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
@ -513,8 +513,8 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
uiOperation = gpio_info.uiGpioValue;
|
uiOperation = gpio_info.uiGpioValue;
|
||||||
value = (1<<uiBit);
|
value = (1<<uiBit);
|
||||||
|
|
||||||
if (IsReqGpioIsLedInNVM(Adapter, value) == false) {
|
if (IsReqGpioIsLedInNVM(ad, value) == false) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL,
|
DBG_LVL_ALL,
|
||||||
"Sorry, Requested GPIO<0x%X> is not correspond to LED !!!",
|
"Sorry, Requested GPIO<0x%X> is not correspond to LED !!!",
|
||||||
value);
|
value);
|
||||||
@ -524,16 +524,16 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
/* Set - setting 1 */
|
/* Set - setting 1 */
|
||||||
if (uiOperation) {
|
if (uiOperation) {
|
||||||
/* Set the gpio output register */
|
/* Set the gpio output register */
|
||||||
Status = wrmaltWithLock(Adapter,
|
Status = wrmaltWithLock(ad,
|
||||||
BCM_GPIO_OUTPUT_SET_REG,
|
BCM_GPIO_OUTPUT_SET_REG,
|
||||||
(PUINT)(&value), sizeof(UINT));
|
(PUINT)(&value), sizeof(UINT));
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS) {
|
if (Status == STATUS_SUCCESS) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS,
|
||||||
OSAL_DBG, DBG_LVL_ALL,
|
OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Set the GPIO bit\n");
|
"Set the GPIO bit\n");
|
||||||
} else {
|
} else {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS,
|
||||||
OSAL_DBG, DBG_LVL_ALL,
|
OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Failed to set the %dth GPIO\n",
|
"Failed to set the %dth GPIO\n",
|
||||||
uiBit);
|
uiBit);
|
||||||
@ -541,16 +541,16 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Set the gpio output register */
|
/* Set the gpio output register */
|
||||||
Status = wrmaltWithLock(Adapter,
|
Status = wrmaltWithLock(ad,
|
||||||
BCM_GPIO_OUTPUT_CLR_REG,
|
BCM_GPIO_OUTPUT_CLR_REG,
|
||||||
(PUINT)(&value), sizeof(UINT));
|
(PUINT)(&value), sizeof(UINT));
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS) {
|
if (Status == STATUS_SUCCESS) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS,
|
||||||
OSAL_DBG, DBG_LVL_ALL,
|
OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Set the GPIO bit\n");
|
"Set the GPIO bit\n");
|
||||||
} else {
|
} else {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS,
|
||||||
OSAL_DBG, DBG_LVL_ALL,
|
OSAL_DBG, DBG_LVL_ALL,
|
||||||
"Failed to clear the %dth GPIO\n",
|
"Failed to clear the %dth GPIO\n",
|
||||||
uiBit);
|
uiBit);
|
||||||
@ -558,11 +558,11 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes = rdmaltWithLock(Adapter, (UINT)GPIO_MODE_REGISTER,
|
bytes = rdmaltWithLock(ad, (UINT)GPIO_MODE_REGISTER,
|
||||||
(PUINT)ucResetValue, sizeof(UINT));
|
(PUINT)ucResetValue, sizeof(UINT));
|
||||||
if (bytes < 0) {
|
if (bytes < 0) {
|
||||||
Status = bytes;
|
Status = bytes;
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,
|
||||||
"GPIO_MODE_REGISTER read failed");
|
"GPIO_MODE_REGISTER read failed");
|
||||||
return Status;
|
return Status;
|
||||||
} else {
|
} else {
|
||||||
@ -571,15 +571,15 @@ static int bcm_char_ioctl_gpio_set_request(void __user *argp,
|
|||||||
|
|
||||||
/* Set the gpio mode register to output */
|
/* Set the gpio mode register to output */
|
||||||
*(UINT *)ucResetValue |= (1<<uiBit);
|
*(UINT *)ucResetValue |= (1<<uiBit);
|
||||||
Status = wrmaltWithLock(Adapter, GPIO_MODE_REGISTER,
|
Status = wrmaltWithLock(ad, GPIO_MODE_REGISTER,
|
||||||
(PUINT)ucResetValue, sizeof(UINT));
|
(PUINT)ucResetValue, sizeof(UINT));
|
||||||
|
|
||||||
if (Status == STATUS_SUCCESS) {
|
if (Status == STATUS_SUCCESS) {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL,
|
DBG_LVL_ALL,
|
||||||
"Set the GPIO to output Mode\n");
|
"Set the GPIO to output Mode\n");
|
||||||
} else {
|
} else {
|
||||||
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG,
|
BCM_DEBUG_PRINT(ad, DBG_TYPE_OTHERS, OSAL_DBG,
|
||||||
DBG_LVL_ALL,
|
DBG_LVL_ALL,
|
||||||
"Failed to put GPIO in Output Mode\n");
|
"Failed to put GPIO in Output Mode\n");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user