Commit bac02ed8 authored by Kevin McKinney's avatar Kevin McKinney Committed by Greg Kroah-Hartman

Staging: bcm: Remove typedef for ioctlbuffer and call directly.

This patch removes typedef for ioctlbuffer, and
changes the name of the struct to bcm_ioctl_buffer.
In addition, any calls to typedefs IOCTL_BUFFER, or
*PIOCTL_BUFFER are changed to call the struct
directly.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d532703c
...@@ -160,7 +160,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -160,7 +160,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
struct bcm_mini_adapter *Adapter = pTarang->Adapter; struct bcm_mini_adapter *Adapter = pTarang->Adapter;
INT Status = STATUS_FAILURE; INT Status = STATUS_FAILURE;
int timeout = 0; int timeout = 0;
IOCTL_BUFFER IoBuffer; struct bcm_ioctl_buffer IoBuffer;
int bytes; int bytes;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Parameters Passed to control IOCTL cmd=0x%X arg=0x%lX", cmd, arg); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Parameters Passed to control IOCTL cmd=0x%X arg=0x%lX", cmd, arg);
...@@ -209,7 +209,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -209,7 +209,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
u16 temp_value; u16 temp_value;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(sRdmBuffer)) if (IoBuffer.InputLength > sizeof(sRdmBuffer))
...@@ -252,7 +252,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -252,7 +252,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
UINT uiTempVar = 0; UINT uiTempVar = 0;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(sWrmBuffer)) if (IoBuffer.InputLength > sizeof(sWrmBuffer))
...@@ -299,7 +299,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -299,7 +299,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(sRdmBuffer)) if (IoBuffer.InputLength > sizeof(sRdmBuffer))
...@@ -356,7 +356,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -356,7 +356,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(sWrmBuffer)) if (IoBuffer.InputLength > sizeof(sWrmBuffer))
...@@ -411,7 +411,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -411,7 +411,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EACCES; return -EACCES;
} }
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(gpio_info)) if (IoBuffer.InputLength > sizeof(gpio_info))
...@@ -490,7 +490,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -490,7 +490,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
break; break;
} }
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(threadReq)) if (IoBuffer.InputLength > sizeof(threadReq))
...@@ -525,7 +525,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -525,7 +525,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
(Adapter->bPreparingForLowPowerMode == TRUE)) (Adapter->bPreparingForLowPowerMode == TRUE))
return -EACCES; return -EACCES;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(gpio_info)) if (IoBuffer.InputLength > sizeof(gpio_info))
...@@ -562,7 +562,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -562,7 +562,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
(Adapter->bPreparingForLowPowerMode == TRUE)) (Adapter->bPreparingForLowPowerMode == TRUE))
return -EINVAL; return -EINVAL;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(gpio_multi_info)) if (IoBuffer.InputLength > sizeof(gpio_multi_info))
...@@ -644,7 +644,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -644,7 +644,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
(Adapter->bPreparingForLowPowerMode == TRUE)) (Adapter->bPreparingForLowPowerMode == TRUE))
return -EINVAL; return -EINVAL;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength > sizeof(gpio_multi_mode)) if (IoBuffer.InputLength > sizeof(gpio_multi_mode))
...@@ -719,7 +719,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -719,7 +719,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
PVOID pvBuffer = NULL; PVOID pvBuffer = NULL;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength < sizeof(struct bcm_link_request)) if (IoBuffer.InputLength < sizeof(struct bcm_link_request))
...@@ -799,7 +799,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -799,7 +799,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) { if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer))) {
up(&Adapter->fw_download_sema); up(&Adapter->fw_download_sema);
return -EFAULT; return -EFAULT;
} }
...@@ -1000,7 +1000,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1000,7 +1000,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
ulong len; ulong len;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
len = min_t(ulong, IoBuffer.OutputLength, strlen(VER_FILEVERSION_STR) + 1); len = min_t(ulong, IoBuffer.OutputLength, strlen(VER_FILEVERSION_STR) + 1);
...@@ -1015,7 +1015,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1015,7 +1015,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
LINK_STATE link_state; LINK_STATE link_state;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) { if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer))) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy_from_user failed..\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy_from_user failed..\n");
return -EFAULT; return -EFAULT;
} }
...@@ -1042,7 +1042,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1042,7 +1042,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
UINT tracing_flag; UINT tracing_flag;
/* copy ioctl Buffer structure */ /* copy ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (copy_from_user(&tracing_flag, IoBuffer.InputBuffer, sizeof(UINT))) if (copy_from_user(&tracing_flag, IoBuffer.InputBuffer, sizeof(UINT)))
...@@ -1057,7 +1057,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1057,7 +1057,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
case IOCTL_BCM_GET_DSX_INDICATION: { case IOCTL_BCM_GET_DSX_INDICATION: {
ULONG ulSFId = 0; ULONG ulSFId = 0;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.OutputLength < sizeof(struct bcm_add_indication_alt)) { if (IoBuffer.OutputLength < sizeof(struct bcm_add_indication_alt)) {
...@@ -1079,7 +1079,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1079,7 +1079,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
case IOCTL_BCM_GET_HOST_MIBS: { case IOCTL_BCM_GET_HOST_MIBS: {
PVOID temp_buff; PVOID temp_buff;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.OutputLength != sizeof(S_MIBS_HOST_STATS_MIBS)) { if (IoBuffer.OutputLength != sizeof(S_MIBS_HOST_STATS_MIBS)) {
...@@ -1132,7 +1132,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1132,7 +1132,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.InputLength < sizeof(ULONG) * 2) if (IoBuffer.InputLength < sizeof(ULONG) * 2)
...@@ -1180,7 +1180,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1180,7 +1180,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
case IOCTL_BCM_GET_NVM_SIZE: case IOCTL_BCM_GET_NVM_SIZE:
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (Adapter->eNVMType == NVM_EEPROM || Adapter->eNVMType == NVM_FLASH) { if (Adapter->eNVMType == NVM_EEPROM || Adapter->eNVMType == NVM_FLASH) {
...@@ -1194,7 +1194,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1194,7 +1194,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
case IOCTL_BCM_CAL_INIT: { case IOCTL_BCM_CAL_INIT: {
UINT uiSectorSize = 0 ; UINT uiSectorSize = 0 ;
if (Adapter->eNVMType == NVM_FLASH) { if (Adapter->eNVMType == NVM_FLASH) {
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (copy_from_user(&uiSectorSize, IoBuffer.InputBuffer, sizeof(UINT))) if (copy_from_user(&uiSectorSize, IoBuffer.InputBuffer, sizeof(UINT)))
...@@ -1231,7 +1231,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1231,7 +1231,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
USER_BCM_DBG_STATE sUserDebugState; USER_BCM_DBG_STATE sUserDebugState;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "In SET_DEBUG ioctl\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "In SET_DEBUG ioctl\n");
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (copy_from_user(&sUserDebugState, IoBuffer.InputBuffer, sizeof(USER_BCM_DBG_STATE))) if (copy_from_user(&sUserDebugState, IoBuffer.InputBuffer, sizeof(USER_BCM_DBG_STATE)))
...@@ -1284,7 +1284,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1284,7 +1284,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (copy_from_user(&stNVMReadWrite, if (copy_from_user(&stNVMReadWrite,
...@@ -1418,7 +1418,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1418,7 +1418,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_FLASH2X_SECTION_READ Called"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_FLASH2X_SECTION_READ Called");
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
/* Reading FLASH 2.x READ structure */ /* Reading FLASH 2.x READ structure */
...@@ -1513,7 +1513,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1513,7 +1513,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_FLASH2X_SECTION_WRITE Called"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_FLASH2X_SECTION_WRITE Called");
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
/* Reading FLASH 2.x READ structure */ /* Reading FLASH 2.x READ structure */
...@@ -1607,7 +1607,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1607,7 +1607,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
struct bcm_flash2x_bitmap *psFlash2xBitMap; struct bcm_flash2x_bitmap *psFlash2xBitMap;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP Called"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP Called");
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.OutputLength != sizeof(struct bcm_flash2x_bitmap)) if (IoBuffer.OutputLength != sizeof(struct bcm_flash2x_bitmap))
...@@ -1652,7 +1652,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1652,7 +1652,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EINVAL; return -EINVAL;
} }
Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)); Status = copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer));
if (Status) { if (Status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
return -EFAULT; return -EFAULT;
...@@ -1702,7 +1702,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1702,7 +1702,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EINVAL; return -EINVAL;
} }
Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)); Status = copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer));
if (Status) { if (Status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed Status :%d", Status); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed Status :%d", Status);
return -EFAULT; return -EFAULT;
...@@ -1769,7 +1769,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1769,7 +1769,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, " IOCTL_BCM_GET_FLASH_CS_INFO Called"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, " IOCTL_BCM_GET_FLASH_CS_INFO Called");
Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)); Status = copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer));
if (Status) { if (Status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
return -EFAULT; return -EFAULT;
...@@ -1808,7 +1808,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1808,7 +1808,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
return -EINVAL; return -EINVAL;
} }
Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)); Status = copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer));
if (Status) { if (Status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
return -EFAULT; return -EFAULT;
...@@ -1856,7 +1856,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1856,7 +1856,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
} }
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) { if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer))) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy_from_user 1 failed\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy_from_user 1 failed\n");
return -EFAULT; return -EFAULT;
} }
...@@ -1933,7 +1933,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1933,7 +1933,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
ULONG RxCntrlMsgBitMask = 0; ULONG RxCntrlMsgBitMask = 0;
/* Copy Ioctl Buffer structure */ /* Copy Ioctl Buffer structure */
Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)); Status = copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer));
if (Status) { if (Status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "copy of Ioctl buffer is failed from user space"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "copy of Ioctl buffer is failed from user space");
return -EFAULT; return -EFAULT;
...@@ -1965,7 +1965,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1965,7 +1965,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
DevInfo.u32NVMType = Adapter->eNVMType; DevInfo.u32NVMType = Adapter->eNVMType;
DevInfo.u32InterfaceType = BCM_USB; DevInfo.u32InterfaceType = BCM_USB;
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.OutputLength < sizeof(DevInfo)) if (IoBuffer.OutputLength < sizeof(DevInfo))
...@@ -1981,7 +1981,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1981,7 +1981,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_TIME_SINCE_NET_ENTRY called"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_TIME_SINCE_NET_ENTRY called");
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER))) if (copy_from_user(&IoBuffer, argp, sizeof(struct bcm_ioctl_buffer)))
return -EFAULT; return -EFAULT;
if (IoBuffer.OutputLength < sizeof(struct bcm_time_elapsed)) if (IoBuffer.OutputLength < sizeof(struct bcm_time_elapsed))
......
...@@ -12,12 +12,12 @@ typedef struct wrmbuffer { ...@@ -12,12 +12,12 @@ typedef struct wrmbuffer {
unsigned char Data[4]; unsigned char Data[4];
} __packed WRM_BUFFER, *PWRM_BUFFER; } __packed WRM_BUFFER, *PWRM_BUFFER;
typedef struct ioctlbuffer { struct bcm_ioctl_buffer {
void __user *InputBuffer; void __user *InputBuffer;
unsigned long InputLength; unsigned long InputLength;
void __user *OutputBuffer; void __user *OutputBuffer;
unsigned long OutputLength; unsigned long OutputLength;
} __packed IOCTL_BUFFER, *PIOCTL_BUFFER; } __packed;
typedef struct stGPIOInfo { typedef struct stGPIOInfo {
unsigned int uiGpioNumber; /* valid numbers 0-15 */ unsigned int uiGpioNumber; /* valid numbers 0-15 */
...@@ -53,7 +53,7 @@ struct bcm_user_thread_req { ...@@ -53,7 +53,7 @@ struct bcm_user_thread_req {
#define IOCTL_CLASSIFICATION_RULE _IOW(BCM_IOCTL, 0x813, char) #define IOCTL_CLASSIFICATION_RULE _IOW(BCM_IOCTL, 0x813, char)
#define IOCTL_CLOSE_NOTIFICATION _IO(BCM_IOCTL, 0x814) #define IOCTL_CLOSE_NOTIFICATION _IO(BCM_IOCTL, 0x814)
#define IOCTL_LINK_UP _IO(BCM_IOCTL, 0x815) #define IOCTL_LINK_UP _IO(BCM_IOCTL, 0x815)
#define IOCTL_LINK_DOWN _IO(BCM_IOCTL, 0x816, IOCTL_BUFFER) #define IOCTL_LINK_DOWN _IO(BCM_IOCTL, 0x816, struct bcm_ioctl_buffer)
#define IOCTL_CHIP_RESET _IO(BCM_IOCTL, 0x816) #define IOCTL_CHIP_RESET _IO(BCM_IOCTL, 0x816)
#define IOCTL_CINR_LEVEL_REQ _IOW(BCM_IOCTL, 0x817, char) #define IOCTL_CINR_LEVEL_REQ _IOW(BCM_IOCTL, 0x817, char)
#define IOCTL_WTM_CONTROL_REQ _IOW(BCM_IOCTL, 0x817, char) #define IOCTL_WTM_CONTROL_REQ _IOW(BCM_IOCTL, 0x817, char)
...@@ -72,7 +72,7 @@ struct bcm_user_thread_req { ...@@ -72,7 +72,7 @@ struct bcm_user_thread_req {
#define IOCTL_BCM_BUFFER_DOWNLOAD_STOP _IOW(BCM_IOCTL, 0x857, int) #define IOCTL_BCM_BUFFER_DOWNLOAD_STOP _IOW(BCM_IOCTL, 0x857, int)
#define IOCTL_BCM_REGISTER_WRITE_PRIVATE _IOW(BCM_IOCTL, 0x826, char) #define IOCTL_BCM_REGISTER_WRITE_PRIVATE _IOW(BCM_IOCTL, 0x826, char)
#define IOCTL_BCM_REGISTER_READ_PRIVATE _IOW(BCM_IOCTL, 0x827, char) #define IOCTL_BCM_REGISTER_READ_PRIVATE _IOW(BCM_IOCTL, 0x827, char)
#define IOCTL_BCM_SET_DEBUG _IOW(BCM_IOCTL, 0x824, IOCTL_BUFFER) #define IOCTL_BCM_SET_DEBUG _IOW(BCM_IOCTL, 0x824, struct bcm_ioctl_buffer)
#define IOCTL_BCM_EEPROM_REGISTER_WRITE _IOW(BCM_IOCTL, 0x858, int) #define IOCTL_BCM_EEPROM_REGISTER_WRITE _IOW(BCM_IOCTL, 0x858, int)
#define IOCTL_BCM_EEPROM_REGISTER_READ _IOR(BCM_IOCTL, 0x859, int) #define IOCTL_BCM_EEPROM_REGISTER_READ _IOR(BCM_IOCTL, 0x859, int)
#define IOCTL_BCM_WAKE_UP_DEVICE_FROM_IDLE _IOR(BCM_IOCTL, 0x860, int) #define IOCTL_BCM_WAKE_UP_DEVICE_FROM_IDLE _IOR(BCM_IOCTL, 0x860, int)
...@@ -96,8 +96,8 @@ struct bcm_user_thread_req { ...@@ -96,8 +96,8 @@ struct bcm_user_thread_req {
#define IOCTL_BCM_GET_DEVICE_DRIVER_INFO _IOR(BCM_IOCTL, 0x877, int) #define IOCTL_BCM_GET_DEVICE_DRIVER_INFO _IOR(BCM_IOCTL, 0x877, int)
#define IOCTL_BCM_TIME_SINCE_NET_ENTRY _IOR(BCM_IOCTL, 0x876, int) #define IOCTL_BCM_TIME_SINCE_NET_ENTRY _IOR(BCM_IOCTL, 0x876, int)
#define BCM_LED_THREAD_STATE_CHANGE_REQ _IOW(BCM_IOCTL, 0x878, int) #define BCM_LED_THREAD_STATE_CHANGE_REQ _IOW(BCM_IOCTL, 0x878, int)
#define IOCTL_BCM_GPIO_MULTI_REQUEST _IOW(BCM_IOCTL, 0x82D, IOCTL_BUFFER) #define IOCTL_BCM_GPIO_MULTI_REQUEST _IOW(BCM_IOCTL, 0x82D, struct bcm_ioctl_buffer)
#define IOCTL_BCM_GPIO_MODE_REQUEST _IOW(BCM_IOCTL, 0x82E, IOCTL_BUFFER) #define IOCTL_BCM_GPIO_MODE_REQUEST _IOW(BCM_IOCTL, 0x82E, struct bcm_ioctl_buffer)
enum bcm_interface_type { enum bcm_interface_type {
BCM_MII, BCM_MII,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment