Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

This patch removes typedef for
_S_INTERFACE_ADAPTER, changes the
name of the struct to bcm_interface_adapter.
In addition, any calls to typedefs
S_INTERFACE_ADAPTER, or *PS_INTERFACE_ADAPTER
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kevin McKinney and committed by
Greg Kroah-Hartman
d6861cfe 48df0187

+53 -53
+1 -1
drivers/staging/bcm/Bcmchar.c
··· 895 895 mdelay(10); 896 896 897 897 /* Wait for MailBox Interrupt */ 898 - if (StartInterruptUrb((PS_INTERFACE_ADAPTER)Adapter->pvInterfaceAdapter)) 898 + if (StartInterruptUrb((struct bcm_interface_adapter *)Adapter->pvInterfaceAdapter)) 899 899 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Unable to send interrupt...\n"); 900 900 901 901 timeout = 5*HZ;
+3 -3
drivers/staging/bcm/Bcmnet.c
··· 142 142 struct ethtool_drvinfo *info) 143 143 { 144 144 struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(dev); 145 - PS_INTERFACE_ADAPTER psIntfAdapter = Adapter->pvInterfaceAdapter; 145 + struct bcm_interface_adapter *psIntfAdapter = Adapter->pvInterfaceAdapter; 146 146 struct usb_device *udev = interface_to_usbdev(psIntfAdapter->interface); 147 147 148 148 strcpy(info->driver, DRV_NAME); ··· 186 186 int register_networkdev(struct bcm_mini_adapter *Adapter) 187 187 { 188 188 struct net_device *net = Adapter->dev; 189 - PS_INTERFACE_ADAPTER IntfAdapter = Adapter->pvInterfaceAdapter; 189 + struct bcm_interface_adapter *IntfAdapter = Adapter->pvInterfaceAdapter; 190 190 struct usb_interface *udev = IntfAdapter->interface; 191 191 struct usb_device *xdev = IntfAdapter->udev; 192 192 ··· 227 227 void unregister_networkdev(struct bcm_mini_adapter *Adapter) 228 228 { 229 229 struct net_device *net = Adapter->dev; 230 - PS_INTERFACE_ADAPTER IntfAdapter = Adapter->pvInterfaceAdapter; 230 + struct bcm_interface_adapter *IntfAdapter = Adapter->pvInterfaceAdapter; 231 231 struct usb_interface *udev = IntfAdapter->interface; 232 232 struct usb_device *xdev = IntfAdapter->udev; 233 233
+2 -2
drivers/staging/bcm/InterfaceAdapter.h
··· 50 50 * This is the interface specific Sub-Adapter 51 51 * Structure. 52 52 */ 53 - typedef struct _S_INTERFACE_ADAPTER { 53 + struct bcm_interface_adapter { 54 54 struct usb_device *udev; 55 55 struct usb_interface *interface; 56 56 /* Bulk endpoint in info */ ··· 75 75 bool bSuspended; 76 76 bool bPreparingForBusSuspend; 77 77 struct work_struct usbSuspendWork; 78 - } S_INTERFACE_ADAPTER, *PS_INTERFACE_ADAPTER; 78 + }; 79 79 80 80 #endif
+2 -2
drivers/staging/bcm/InterfaceDld.c
··· 6 6 mm_segment_t oldfs = {0}; 7 7 int errno = 0, len = 0; /* ,is_config_file = 0 */ 8 8 loff_t pos = 0; 9 - PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg; 9 + struct bcm_interface_adapter *psIntfAdapter = (struct bcm_interface_adapter *)arg; 10 10 /* struct bcm_mini_adapter *Adapter = psIntfAdapter->psAdapter; */ 11 11 char *buff = kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_KERNEL); 12 12 ··· 61 61 loff_t pos = 0; 62 62 static int fw_down; 63 63 INT Status = STATUS_SUCCESS; 64 - PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg; 64 + struct bcm_interface_adapter *psIntfAdapter = (struct bcm_interface_adapter *)arg; 65 65 int bytes; 66 66 67 67 buff = kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_DMA);
+1 -1
drivers/staging/bcm/InterfaceIdleMode.c
··· 156 156 157 157 int lenwritten = 0; 158 158 unsigned char aucAbortPattern[8]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; 159 - PS_INTERFACE_ADAPTER psInterfaceAdapter = Adapter->pvInterfaceAdapter; 159 + struct bcm_interface_adapter *psInterfaceAdapter = Adapter->pvInterfaceAdapter; 160 160 161 161 //Abort Bus suspend if its already suspended 162 162 if((TRUE == psInterfaceAdapter->bSuspended) && (TRUE == Adapter->bDoSuspend))
+11 -11
drivers/staging/bcm/InterfaceInit.c
··· 22 22 | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR 23 23 | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN; 24 24 25 - static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER Adapter); 25 + static int InterfaceAdapterInit(struct bcm_interface_adapter *Adapter); 26 26 27 - static void InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter) 27 + static void InterfaceAdapterFree(struct bcm_interface_adapter *psIntfAdapter) 28 28 { 29 29 int i = 0; 30 30 ··· 79 79 80 80 ulReg = ntohl(EP2_CFG_REG); 81 81 BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x132, 4, TRUE); 82 - if (((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter))->bHighSpeedDevice == TRUE) { 82 + if (((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter))->bHighSpeedDevice == TRUE) { 83 83 ulReg = ntohl(EP2_CFG_INT); 84 84 BeceemEEPROMBulkWrite(Adapter, (PUCHAR)&ulReg, 0x136, 4, TRUE); 85 85 } else { ··· 145 145 struct usb_device *udev = interface_to_usbdev(intf); 146 146 int retval; 147 147 struct bcm_mini_adapter *psAdapter; 148 - PS_INTERFACE_ADAPTER psIntfAdapter; 148 + struct bcm_interface_adapter *psIntfAdapter; 149 149 struct net_device *ndev; 150 150 151 151 /* Reserve one extra queue for the bit-bucket */ ··· 189 189 } 190 190 191 191 /* Allocate interface adapter structure */ 192 - psIntfAdapter = kzalloc(sizeof(S_INTERFACE_ADAPTER), GFP_KERNEL); 192 + psIntfAdapter = kzalloc(sizeof(struct bcm_interface_adapter), GFP_KERNEL); 193 193 if (psIntfAdapter == NULL) { 194 194 dev_err(&udev->dev, DRV_NAME ": no memory for Interface adapter\n"); 195 195 AdapterFree(psAdapter); ··· 257 257 258 258 static void usbbcm_disconnect(struct usb_interface *intf) 259 259 { 260 - PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); 260 + struct bcm_interface_adapter *psIntfAdapter = usb_get_intfdata(intf); 261 261 struct bcm_mini_adapter *psAdapter; 262 262 struct usb_device *udev = interface_to_usbdev(intf); 263 263 ··· 276 276 usb_put_dev(udev); 277 277 } 278 278 279 - static int AllocUsbCb(PS_INTERFACE_ADAPTER psIntfAdapter) 279 + static int AllocUsbCb(struct bcm_interface_adapter *psIntfAdapter) 280 280 { 281 281 int i = 0; 282 282 ··· 311 311 return 0; 312 312 } 313 313 314 - static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter) 314 + static int device_run(struct bcm_interface_adapter *psIntfAdapter) 315 315 { 316 316 int value = 0; 317 317 UINT status = STATUS_SUCCESS; ··· 421 421 return bcm_usb_endpoint_xfer_isoc(epd) && bcm_usb_endpoint_dir_out(epd); 422 422 } 423 423 424 - static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) 424 + static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) 425 425 { 426 426 struct usb_host_interface *iface_desc; 427 427 struct usb_endpoint_descriptor *endpoint; ··· 619 619 620 620 static int InterfaceSuspend(struct usb_interface *intf, pm_message_t message) 621 621 { 622 - PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); 622 + struct bcm_interface_adapter *psIntfAdapter = usb_get_intfdata(intf); 623 623 624 624 psIntfAdapter->bSuspended = TRUE; 625 625 ··· 646 646 647 647 static int InterfaceResume(struct usb_interface *intf) 648 648 { 649 - PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); 649 + struct bcm_interface_adapter *psIntfAdapter = usb_get_intfdata(intf); 650 650 651 651 mdelay(100); 652 652 psIntfAdapter->bSuspended = FALSE;
+1 -1
drivers/staging/bcm/InterfaceInit.h
··· 21 21 22 22 int InterfaceExit(void); 23 23 24 - int usbbcm_worker_thread(PS_INTERFACE_ADAPTER psIntfAdapter); 24 + int usbbcm_worker_thread(struct bcm_interface_adapter *psIntfAdapter); 25 25 26 26 #endif
+3 -3
drivers/staging/bcm/InterfaceIsr.c
··· 4 4 static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/) 5 5 { 6 6 int status = urb->status; 7 - PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)urb->context; 7 + struct bcm_interface_adapter *psIntfAdapter = (struct bcm_interface_adapter *)urb->context; 8 8 struct bcm_mini_adapter *Adapter = psIntfAdapter->psAdapter ; 9 9 10 10 if (netif_msg_intr(Adapter)) ··· 114 114 115 115 } 116 116 117 - int CreateInterruptUrb(PS_INTERFACE_ADAPTER psIntfAdapter) 117 + int CreateInterruptUrb(struct bcm_interface_adapter *psIntfAdapter) 118 118 { 119 119 psIntfAdapter->psInterruptUrb = usb_alloc_urb(0, GFP_KERNEL); 120 120 if (!psIntfAdapter->psInterruptUrb) ··· 143 143 } 144 144 145 145 146 - INT StartInterruptUrb(PS_INTERFACE_ADAPTER psIntfAdapter) 146 + INT StartInterruptUrb(struct bcm_interface_adapter *psIntfAdapter) 147 147 { 148 148 INT status = 0; 149 149
+2 -2
drivers/staging/bcm/InterfaceIsr.h
··· 1 1 #ifndef _INTERFACE_ISR_H 2 2 #define _INTERFACE_ISR_H 3 3 4 - int CreateInterruptUrb(PS_INTERFACE_ADAPTER psIntfAdapter); 4 + int CreateInterruptUrb(struct bcm_interface_adapter *psIntfAdapter); 5 5 6 6 7 - INT StartInterruptUrb(PS_INTERFACE_ADAPTER psIntfAdapter); 7 + INT StartInterruptUrb(struct bcm_interface_adapter *psIntfAdapter); 8 8 9 9 10 10 VOID InterfaceEnableInterrupt(struct bcm_mini_adapter *Adapter);
+8 -8
drivers/staging/bcm/InterfaceMisc.c
··· 1 1 #include "headers.h" 2 2 3 - int InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter, 3 + int InterfaceRDM(struct bcm_interface_adapter *psIntfAdapter, 4 4 unsigned int addr, 5 5 void *buff, 6 6 int len) ··· 48 48 return bytes; 49 49 } 50 50 51 - int InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter, 51 + int InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter, 52 52 unsigned int addr, 53 53 void *buff, 54 54 int len) ··· 104 104 void *buff, 105 105 int len) 106 106 { 107 - return InterfaceRDM((PS_INTERFACE_ADAPTER)arg, addr, buff, len); 107 + return InterfaceRDM((struct bcm_interface_adapter*)arg, addr, buff, len); 108 108 } 109 109 110 110 int BcmWRM(void *arg, ··· 112 112 void *buff, 113 113 int len) 114 114 { 115 - return InterfaceWRM((PS_INTERFACE_ADAPTER)arg, addr, buff, len); 115 + return InterfaceWRM((struct bcm_interface_adapter *)arg, addr, buff, len); 116 116 } 117 117 118 118 int Bcm_clear_halt_of_endpoints(struct bcm_mini_adapter *Adapter) 119 119 { 120 - PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter); 120 + struct bcm_interface_adapter *psIntfAdapter = (struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter); 121 121 int status = STATUS_SUCCESS; 122 122 123 123 /* ··· 154 154 return status; 155 155 } 156 156 157 - void Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter) 157 + void Bcm_kill_all_URBs(struct bcm_interface_adapter *psIntfAdapter) 158 158 { 159 159 struct urb *tempUrb = NULL; 160 160 unsigned int i; ··· 206 206 207 207 void putUsbSuspend(struct work_struct *work) 208 208 { 209 - PS_INTERFACE_ADAPTER psIntfAdapter = NULL; 209 + struct bcm_interface_adapter *psIntfAdapter = NULL; 210 210 struct usb_interface *intf = NULL; 211 - psIntfAdapter = container_of(work, S_INTERFACE_ADAPTER, usbSuspendWork); 211 + psIntfAdapter = container_of(work, struct bcm_interface_adapter, usbSuspendWork); 212 212 intf = psIntfAdapter->interface; 213 213 214 214 if (psIntfAdapter->bSuspended == FALSE)
+3 -3
drivers/staging/bcm/InterfaceMisc.h
··· 2 2 #define __INTERFACE_MISC_H 3 3 4 4 INT 5 - InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter, 5 + InterfaceRDM(struct bcm_interface_adapter *psIntfAdapter, 6 6 UINT addr, 7 7 PVOID buff, 8 8 INT len); 9 9 10 10 INT 11 - InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter, 11 + InterfaceWRM(struct bcm_interface_adapter *psIntfAdapter, 12 12 UINT addr, 13 13 PVOID buff, 14 14 INT len); ··· 35 35 36 36 INT Bcm_clear_halt_of_endpoints(struct bcm_mini_adapter *Adapter); 37 37 38 - VOID Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter); 38 + VOID Bcm_kill_all_URBs(struct bcm_interface_adapter *psIntfAdapter); 39 39 40 40 #define DISABLE_USB_ZERO_LEN_INT 0x0F011878 41 41
+4 -4
drivers/staging/bcm/InterfaceRx.c
··· 13 13 14 14 15 15 static PUSB_RCB 16 - GetBulkInRcb(PS_INTERFACE_ADAPTER psIntfAdapter) 16 + GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter) 17 17 { 18 18 PUSB_RCB pRcb = NULL; 19 19 UINT index = 0; ··· 44 44 int process_done = 1; 45 45 //int idleflag = 0 ; 46 46 PUSB_RCB pRcb = (PUSB_RCB)urb->context; 47 - PS_INTERFACE_ADAPTER psIntfAdapter = pRcb->psIntfAdapter; 47 + struct bcm_interface_adapter *psIntfAdapter = pRcb->psIntfAdapter; 48 48 struct bcm_mini_adapter *Adapter = psIntfAdapter->psAdapter; 49 49 struct bcm_leader *pLeader = urb->transfer_buffer; 50 50 ··· 196 196 atomic_dec(&psIntfAdapter->uNumRcbUsed); 197 197 } 198 198 199 - static int ReceiveRcb(PS_INTERFACE_ADAPTER psIntfAdapter, PUSB_RCB pRcb) 199 + static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, PUSB_RCB pRcb) 200 200 { 201 201 struct urb *urb = pRcb->urb; 202 202 int retval = 0; ··· 240 240 Other - If an error occurred. 241 241 */ 242 242 243 - BOOLEAN InterfaceRx (PS_INTERFACE_ADAPTER psIntfAdapter) 243 + BOOLEAN InterfaceRx (struct bcm_interface_adapter *psIntfAdapter) 244 244 { 245 245 USHORT RxDescCount = NUM_RX_DESC - atomic_read(&psIntfAdapter->uNumRcbUsed); 246 246 PUSB_RCB pRcb = NULL;
+1 -1
drivers/staging/bcm/InterfaceRx.h
··· 1 1 #ifndef _INTERFACE_RX_H 2 2 #define _INTERFACE_RX_H 3 3 4 - BOOLEAN InterfaceRx(PS_INTERFACE_ADAPTER Adapter); 4 + BOOLEAN InterfaceRx(struct bcm_interface_adapter *Adapter); 5 5 6 6 #endif 7 7
+4 -4
drivers/staging/bcm/InterfaceTx.c
··· 4 4 static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) 5 5 { 6 6 PUSB_TCB pTcb= (PUSB_TCB)urb->context; 7 - PS_INTERFACE_ADAPTER psIntfAdapter = pTcb->psIntfAdapter; 7 + struct bcm_interface_adapter *psIntfAdapter = pTcb->psIntfAdapter; 8 8 struct bcm_link_request *pControlMsg = (struct bcm_link_request *)urb->transfer_buffer; 9 9 struct bcm_mini_adapter *psAdapter = psIntfAdapter->psAdapter ; 10 10 BOOLEAN bpowerDownMsg = FALSE ; ··· 107 107 } 108 108 109 109 110 - static PUSB_TCB GetBulkOutTcb(PS_INTERFACE_ADAPTER psIntfAdapter) 110 + static PUSB_TCB GetBulkOutTcb(struct bcm_interface_adapter *psIntfAdapter) 111 111 { 112 112 PUSB_TCB pTcb = NULL; 113 113 UINT index = 0; ··· 128 128 return pTcb; 129 129 } 130 130 131 - static int TransmitTcb(PS_INTERFACE_ADAPTER psIntfAdapter, PUSB_TCB pTcb, PVOID data, int len) 131 + static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, PUSB_TCB pTcb, PVOID data, int len) 132 132 { 133 133 134 134 struct urb *urb = pTcb->urb; ··· 184 184 { 185 185 PUSB_TCB pTcb= NULL; 186 186 187 - PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg; 187 + struct bcm_interface_adapter *psIntfAdapter = (struct bcm_interface_adapter *)arg; 188 188 pTcb= GetBulkOutTcb(psIntfAdapter); 189 189 if(pTcb == NULL) 190 190 {
+6 -6
drivers/staging/bcm/Misc.c
··· 611 611 up(&Adapter->rdmwrmsync); 612 612 /* Killing all URBS. */ 613 613 if (Adapter->bDoSuspend == TRUE) 614 - Bcm_kill_all_URBs((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); 614 + Bcm_kill_all_URBs((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); 615 615 } else { 616 616 Adapter->bPreparingForLowPowerMode = FALSE; 617 617 } ··· 627 627 if ((status != STATUS_SUCCESS)) { 628 628 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "fail to send the Idle mode Request\n"); 629 629 Adapter->bPreparingForLowPowerMode = FALSE; 630 - StartInterruptUrb((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); 630 + StartInterruptUrb((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); 631 631 } 632 632 do_gettimeofday(&tv); 633 633 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "IdleMode Msg submitter to Q :%ld ms", tv.tv_sec * 1000 + tv.tv_usec / 1000); ··· 778 778 { 779 779 int retval = STATUS_SUCCESS; 780 780 struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev); 781 - PS_INTERFACE_ADAPTER psIntfAdapter = NULL; 781 + struct bcm_interface_adapter *psIntfAdapter = NULL; 782 782 unsigned int value = 0, uiResetValue = 0; 783 783 int bytes; 784 784 785 - psIntfAdapter = ((PS_INTERFACE_ADAPTER)(ps_adapter->pvInterfaceAdapter)); 785 + psIntfAdapter = ((struct bcm_interface_adapter *)(ps_adapter->pvInterfaceAdapter)); 786 786 ps_adapter->bDDRInitDone = FALSE; 787 787 788 788 if (ps_adapter->chip_id >= T3LPB) { ··· 1372 1372 up(&Adapter->rdmwrmsync); 1373 1373 /* Killing all URBS. */ 1374 1374 if (Adapter->bDoSuspend == TRUE) 1375 - Bcm_kill_all_URBs((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); 1375 + Bcm_kill_all_URBs((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); 1376 1376 } else { 1377 1377 Adapter->bPreparingForLowPowerMode = FALSE; 1378 1378 } ··· 1388 1388 if ((Status != STATUS_SUCCESS)) { 1389 1389 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "fail to send the Idle mode Request\n"); 1390 1390 Adapter->bPreparingForLowPowerMode = FALSE; 1391 - StartInterruptUrb((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); 1391 + StartInterruptUrb((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); 1392 1392 } 1393 1393 } 1394 1394
+1 -1
drivers/staging/bcm/Transmit.c
··· 205 205 if (Adapter->bEndPointHalted == TRUE) { 206 206 Bcm_clear_halt_of_endpoints(Adapter); 207 207 Adapter->bEndPointHalted = FALSE; 208 - StartInterruptUrb((PS_INTERFACE_ADAPTER)(Adapter->pvInterfaceAdapter)); 208 + StartInterruptUrb((struct bcm_interface_adapter *)(Adapter->pvInterfaceAdapter)); 209 209 } 210 210 211 211 if (Adapter->LinkUpStatus && !Adapter->IdleMode) {