Commit a02b67b6 authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman

Staging: bcm: Replaced member accessing with variable in InterfaceAdapterInit()

Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9e58842f
...@@ -385,6 +385,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -385,6 +385,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
bool bBcm16 = false; bool bBcm16 = false;
UINT uiData = 0; UINT uiData = 0;
int bytes; int bytes;
struct bcm_mini_adapter *psAd = psIntfAdapter->psAdapter;
/* Store the usb dev into interface adapter */ /* Store the usb dev into interface adapter */
psIntfAdapter->udev = psIntfAdapter->udev =
...@@ -392,31 +393,31 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -392,31 +393,31 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
psIntfAdapter->bHighSpeedDevice = psIntfAdapter->bHighSpeedDevice =
(psIntfAdapter->udev->speed == USB_SPEED_HIGH); (psIntfAdapter->udev->speed == USB_SPEED_HIGH);
psIntfAdapter->psAdapter->interface_rdm = BcmRDM; psAd->interface_rdm = BcmRDM;
psIntfAdapter->psAdapter->interface_wrm = BcmWRM; psAd->interface_wrm = BcmWRM;
bytes = rdmalt(psIntfAdapter->psAdapter, CHIP_ID_REG, bytes = rdmalt(psAd, CHIP_ID_REG,
(u32 *) &(psIntfAdapter->psAdapter->chip_id), (u32 *) &(psAd->chip_id),
sizeof(u32)); sizeof(u32));
if (bytes < 0) { if (bytes < 0) {
retval = bytes; retval = bytes;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, BCM_DEBUG_PRINT(psAd, DBG_TYPE_PRINTK, 0, 0,
"CHIP ID Read Failed\n"); "CHIP ID Read Failed\n");
return retval; return retval;
} }
if (0xbece3200 == (psIntfAdapter->psAdapter->chip_id & ~(0xF0))) if (0xbece3200 == (psAd->chip_id & ~(0xF0)))
psIntfAdapter->psAdapter->chip_id &= ~0xF0; psAd->chip_id &= ~0xF0;
dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n", dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n",
psIntfAdapter->psAdapter->chip_id); psAd->chip_id);
iface_desc = psIntfAdapter->interface->cur_altsetting; iface_desc = psIntfAdapter->interface->cur_altsetting;
if (psIntfAdapter->psAdapter->chip_id == T3B) { if (psAd->chip_id == T3B) {
/* T3B device will have EEPROM, check if EEPROM is proper and /* T3B device will have EEPROM, check if EEPROM is proper and
* BCM16 can be done or not. */ * BCM16 can be done or not. */
BeceemEEPROMBulkRead(psIntfAdapter->psAdapter, &uiData, 0x0, 4); BeceemEEPROMBulkRead(psAd, &uiData, 0x0, 4);
if (uiData == BECM) if (uiData == BECM)
bBcm16 = TRUE; bBcm16 = TRUE;
...@@ -431,14 +432,14 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -431,14 +432,14 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
retval = usb_set_interface(psIntfAdapter->udev, retval = usb_set_interface(psIntfAdapter->udev,
DEFAULT_SETTING_0, DEFAULT_SETTING_0,
ALTERNATE_SETTING_1); ALTERNATE_SETTING_1);
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL, DBG_LVL_ALL,
"BCM16 is applicable on this dongle\n"); "BCM16 is applicable on this dongle\n");
if (retval || !psIntfAdapter->bHighSpeedDevice) { if (retval || !psIntfAdapter->bHighSpeedDevice) {
usedIntOutForBulkTransfer = EP2; usedIntOutForBulkTransfer = EP2;
endpoint = &iface_desc->endpoint[EP2].desc; endpoint = &iface_desc->endpoint[EP2].desc;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL, DBG_LVL_ALL,
"Interface altsetting failed or modem is configured to Full Speed, hence will work on default setting 0\n"); "Interface altsetting failed or modem is configured to Full Speed, hence will work on default setting 0\n");
...@@ -453,13 +454,13 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -453,13 +454,13 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
!usb_endpoint_is_int_out(endpoint)) || !usb_endpoint_is_int_out(endpoint)) ||
(!psIntfAdapter->bHighSpeedDevice && (!psIntfAdapter->bHighSpeedDevice &&
!usb_endpoint_is_bulk_out(endpoint))) { !usb_endpoint_is_bulk_out(endpoint))) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL, DRV_ENTRY, DBG_LVL_ALL,
"Configuring the EEPROM\n"); "Configuring the EEPROM\n");
/* change the EP2, EP4 to INT OUT end point */ /* change the EP2, EP4 to INT OUT end point */
ConfigureEndPointTypesThroughEEPROM( ConfigureEndPointTypesThroughEEPROM(
psIntfAdapter->psAdapter); psAd);
/* /*
* It resets the device and if any thing * It resets the device and if any thing
...@@ -470,7 +471,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -470,7 +471,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
retval = usb_reset_device( retval = usb_reset_device(
psIntfAdapter->udev); psIntfAdapter->udev);
if (retval) { if (retval) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DBG_TYPE_INITEXIT,
DRV_ENTRY, DRV_ENTRY,
DBG_LVL_ALL, DBG_LVL_ALL,
...@@ -483,30 +484,30 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -483,30 +484,30 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
usb_endpoint_is_bulk_out(endpoint)) { usb_endpoint_is_bulk_out(endpoint)) {
/* Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. */ /* Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. */
UINT _uiData = ntohl(EP2_CFG_INT); UINT _uiData = ntohl(EP2_CFG_INT);
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL, DRV_ENTRY, DBG_LVL_ALL,
"Reverting Bulk to INT as it is in Full Speed mode.\n"); "Reverting Bulk to INT as it is in Full Speed mode.\n");
BeceemEEPROMBulkWrite( BeceemEEPROMBulkWrite(
psIntfAdapter->psAdapter, psAd,
(PUCHAR) & _uiData, (PUCHAR) & _uiData,
0x136, 4, TRUE); 0x136, 4, TRUE);
} }
} else { } else {
usedIntOutForBulkTransfer = EP4; usedIntOutForBulkTransfer = EP4;
endpoint = &iface_desc->endpoint[EP4].desc; endpoint = &iface_desc->endpoint[EP4].desc;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_TYPE_INITEXIT, DRV_ENTRY,
DBG_LVL_ALL, DBG_LVL_ALL,
"Choosing AltSetting as a default setting.\n"); "Choosing AltSetting as a default setting.\n");
if (!usb_endpoint_is_int_out(endpoint)) { if (!usb_endpoint_is_int_out(endpoint)) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DBG_TYPE_INITEXIT,
DRV_ENTRY, DBG_LVL_ALL, DRV_ENTRY, DBG_LVL_ALL,
"Dongle does not have BCM16 Fix.\n"); "Dongle does not have BCM16 Fix.\n");
/* change the EP2, EP4 to INT OUT end point and use EP4 in altsetting */ /* change the EP2, EP4 to INT OUT end point and use EP4 in altsetting */
ConfigureEndPointTypesThroughEEPROM( ConfigureEndPointTypesThroughEEPROM(
psIntfAdapter->psAdapter); psAd);
/* /*
* It resets the device and if any thing * It resets the device and if any thing
...@@ -517,7 +518,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -517,7 +518,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
retval = usb_reset_device( retval = usb_reset_device(
psIntfAdapter->udev); psIntfAdapter->udev);
if (retval) { if (retval) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psAd,
DBG_TYPE_INITEXIT, DBG_TYPE_INITEXIT,
DRV_ENTRY, DRV_ENTRY,
DBG_LVL_ALL, DBG_LVL_ALL,
...@@ -572,7 +573,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -572,7 +573,7 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && if (!psIntfAdapter->sIntrOut.int_out_endpointAddr &&
usb_endpoint_is_int_out(endpoint)) { usb_endpoint_is_int_out(endpoint)) {
if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr && if (!psIntfAdapter->sBulkOut.bulk_out_endpointAddr &&
(psIntfAdapter->psAdapter->chip_id == T3B) && (psAd->chip_id == T3B) &&
(value == usedIntOutForBulkTransfer)) { (value == usedIntOutForBulkTransfer)) {
/* use first intout end point as a bulk out end point */ /* use first intout end point as a bulk out end point */
buffer_size = buffer_size =
...@@ -606,15 +607,15 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter) ...@@ -606,15 +607,15 @@ static int InterfaceAdapterInit(struct bcm_interface_adapter *psIntfAdapter)
usb_set_intfdata(psIntfAdapter->interface, psIntfAdapter); usb_set_intfdata(psIntfAdapter->interface, psIntfAdapter);
psIntfAdapter->psAdapter->bcm_file_download = InterfaceFileDownload; psAd->bcm_file_download = InterfaceFileDownload;
psIntfAdapter->psAdapter->bcm_file_readback_from_chip = psAd->bcm_file_readback_from_chip =
InterfaceFileReadbackFromChip; InterfaceFileReadbackFromChip;
psIntfAdapter->psAdapter->interface_transmit = InterfaceTransmitPacket; psAd->interface_transmit = InterfaceTransmitPacket;
retval = CreateInterruptUrb(psIntfAdapter); retval = CreateInterruptUrb(psIntfAdapter);
if (retval) { if (retval) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, BCM_DEBUG_PRINT(psAd, DBG_TYPE_PRINTK, 0, 0,
"Cannot create interrupt urb\n"); "Cannot create interrupt urb\n");
return retval; return retval;
} }
......
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