beceem: module initialization
Get rid of boot messages and put in correct place. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
This commit is contained in:
parent
4fd64dd0c1
commit
2d08748ae5
5 changed files with 75 additions and 154 deletions
|
@ -241,25 +241,3 @@ int register_networkdev(PMINI_ADAPTER Adapter)
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bcm_init(void)
|
|
||||||
{
|
|
||||||
printk(KERN_INFO "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
|
|
||||||
printk(KERN_INFO "%s\n", DRV_COPYRIGHT);
|
|
||||||
|
|
||||||
return InterfaceInitialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void bcm_exit(void)
|
|
||||||
{
|
|
||||||
InterfaceExit();
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(bcm_init);
|
|
||||||
module_exit(bcm_exit);
|
|
||||||
|
|
||||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
|
||||||
MODULE_VERSION(DRV_VERSION);
|
|
||||||
MODULE_LICENSE ("GPL");
|
|
||||||
|
|
||||||
|
|
|
@ -338,13 +338,11 @@ static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
status = InitCardAndDownloadFirmware(psIntfAdapter->psAdapter);
|
status = InitCardAndDownloadFirmware(psIntfAdapter->psAdapter);
|
||||||
if(status != STATUS_SUCCESS)
|
if(status != STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "InitCardAndDownloadFirmware failed.\n");
|
pr_err(DRV_NAME "InitCardAndDownloadFirmware failed.\n");
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
if(TRUE == psIntfAdapter->psAdapter->fw_download_done)
|
if(TRUE == psIntfAdapter->psAdapter->fw_download_done)
|
||||||
{
|
{
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Sending first interrupt URB down......");
|
|
||||||
if(StartInterruptUrb(psIntfAdapter))
|
if(StartInterruptUrb(psIntfAdapter))
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Cannot send interrupt in URB");
|
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Cannot send interrupt in URB");
|
||||||
|
@ -357,16 +355,11 @@ static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
psIntfAdapter->psAdapter->waiting_to_fw_download_done, 5*HZ);
|
psIntfAdapter->psAdapter->waiting_to_fw_download_done, 5*HZ);
|
||||||
|
|
||||||
if(value == 0)
|
if(value == 0)
|
||||||
{
|
pr_err(DRV_NAME ": Mailbox Interrupt has not reached to Driver..\n");
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Mailbox Interrupt has not reached to Driver..");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Got the mailbox interrupt ...Registering control interface...\n ");
|
|
||||||
}
|
|
||||||
if(register_control_device_interface(psIntfAdapter->psAdapter) < 0)
|
if(register_control_device_interface(psIntfAdapter->psAdapter) < 0)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Register Control Device failed...");
|
pr_err(DRV_NAME ": Register Control Device failed...\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,20 +453,9 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
UINT uiData = 0;
|
UINT uiData = 0;
|
||||||
|
|
||||||
/* Store the usb dev into interface adapter */
|
/* Store the usb dev into interface adapter */
|
||||||
psIntfAdapter->udev = usb_get_dev(interface_to_usbdev(
|
psIntfAdapter->udev = usb_get_dev(interface_to_usbdev(psIntfAdapter->interface));
|
||||||
psIntfAdapter->interface));
|
|
||||||
|
|
||||||
if((psIntfAdapter->udev->speed == USB_SPEED_HIGH))
|
|
||||||
{
|
|
||||||
psIntfAdapter->bHighSpeedDevice = TRUE ;
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "MODEM IS CONFIGURED TO HIGH_SPEED ");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
psIntfAdapter->bHighSpeedDevice = FALSE ;
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "MODEM IS CONFIGURED TO FULL_SPEED ");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
psIntfAdapter->bHighSpeedDevice = (psIntfAdapter->udev->speed == USB_SPEED_HIGH);
|
||||||
psIntfAdapter->psAdapter->interface_rdm = BcmRDM;
|
psIntfAdapter->psAdapter->interface_rdm = BcmRDM;
|
||||||
psIntfAdapter->psAdapter->interface_wrm = BcmWRM;
|
psIntfAdapter->psAdapter->interface_wrm = BcmWRM;
|
||||||
|
|
||||||
|
@ -482,28 +464,27 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "CHIP ID Read Failed\n");
|
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "CHIP ID Read Failed\n");
|
||||||
return STATUS_FAILURE;
|
return STATUS_FAILURE;
|
||||||
}
|
}
|
||||||
if(0xbece3200==(psIntfAdapter->psAdapter->chip_id&~(0xF0)))
|
|
||||||
{
|
|
||||||
psIntfAdapter->psAdapter->chip_id=(psIntfAdapter->psAdapter->chip_id&~(0xF0));
|
|
||||||
}
|
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "First RDM Chip ID 0x%lx\n", psIntfAdapter->psAdapter->chip_id);
|
if(0xbece3200==(psIntfAdapter->psAdapter->chip_id&~(0xF0)))
|
||||||
|
psIntfAdapter->psAdapter->chip_id &= ~0xF0;
|
||||||
|
|
||||||
|
dev_info(&psIntfAdapter->udev->dev, "RDM Chip ID 0x%lx\n",
|
||||||
|
psIntfAdapter->psAdapter->chip_id);
|
||||||
|
|
||||||
iface_desc = psIntfAdapter->interface->cur_altsetting;
|
iface_desc = psIntfAdapter->interface->cur_altsetting;
|
||||||
//print_usb_interface_desc(&(iface_desc->desc));
|
|
||||||
|
|
||||||
if(psIntfAdapter->psAdapter->chip_id == T3B)
|
if(psIntfAdapter->psAdapter->chip_id == T3B)
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
//T3B device will have EEPROM,check if EEPROM is proper and BCM16 can be done or not.
|
//T3B device will have EEPROM,check if EEPROM is proper and BCM16 can be done or not.
|
||||||
//
|
//
|
||||||
BeceemEEPROMBulkRead(psIntfAdapter->psAdapter,&uiData,0x0,4);
|
BeceemEEPROMBulkRead(psIntfAdapter->psAdapter,&uiData,0x0,4);
|
||||||
if(uiData == BECM)
|
if(uiData == BECM)
|
||||||
{
|
|
||||||
bBcm16 = TRUE;
|
bBcm16 = TRUE;
|
||||||
}
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Number of Altsetting aviailable for This Modem 0x%x\n", psIntfAdapter->interface->num_altsetting);
|
dev_info(&psIntfAdapter->udev->dev, "number of alternate setting %d\n",
|
||||||
|
psIntfAdapter->interface->num_altsetting);
|
||||||
|
|
||||||
if(bBcm16 == TRUE)
|
if(bBcm16 == TRUE)
|
||||||
{
|
{
|
||||||
//selecting alternate setting one as a default setting for High Speed modem.
|
//selecting alternate setting one as a default setting for High Speed modem.
|
||||||
|
@ -574,12 +555,10 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
iface_desc = psIntfAdapter->interface->cur_altsetting;
|
iface_desc = psIntfAdapter->interface->cur_altsetting;
|
||||||
//print_usb_interface_desc(&(iface_desc->desc));
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Current number of endpoints :%x \n", iface_desc->desc.bNumEndpoints);
|
|
||||||
for (value = 0; value < iface_desc->desc.bNumEndpoints; ++value)
|
for (value = 0; value < iface_desc->desc.bNumEndpoints; ++value)
|
||||||
{
|
{
|
||||||
endpoint = &iface_desc->endpoint[value].desc;
|
endpoint = &iface_desc->endpoint[value].desc;
|
||||||
//print_usb_endpoint_descriptor(endpoint);
|
|
||||||
|
|
||||||
if (!psIntfAdapter->sBulkIn.bulk_in_endpointAddr && bcm_usb_endpoint_is_bulk_in(endpoint))
|
if (!psIntfAdapter->sBulkIn.bulk_in_endpointAddr && bcm_usb_endpoint_is_bulk_in(endpoint))
|
||||||
{
|
{
|
||||||
|
@ -612,10 +591,10 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
psIntfAdapter->sIntrIn.int_in_buffer =
|
psIntfAdapter->sIntrIn.int_in_buffer =
|
||||||
kmalloc(buffer_size, GFP_KERNEL);
|
kmalloc(buffer_size, GFP_KERNEL);
|
||||||
if (!psIntfAdapter->sIntrIn.int_in_buffer) {
|
if (!psIntfAdapter->sIntrIn.int_in_buffer) {
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Could not allocate interrupt_in_buffer");
|
dev_err(&psIntfAdapter->udev->dev,
|
||||||
|
"could not allocate interrupt_in_buffer\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
//psIntfAdapter->sIntrIn.int_in_pipe =
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && bcm_usb_endpoint_is_int_out(endpoint))
|
if (!psIntfAdapter->sIntrOut.int_out_endpointAddr && bcm_usb_endpoint_is_int_out(endpoint))
|
||||||
|
@ -647,7 +626,8 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!psIntfAdapter->sIntrOut.int_out_buffer)
|
if (!psIntfAdapter->sIntrOut.int_out_buffer)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Could not allocate interrupt_out_buffer");
|
dev_err(&psIntfAdapter->udev->dev,
|
||||||
|
"could not allocate interrupt_out_buffer\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -681,8 +661,7 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
static int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
|
static int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
|
||||||
{
|
{
|
||||||
PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf);
|
PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf);
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=================================\n");
|
|
||||||
//Bcm_kill_all_URBs(psIntfAdapter);
|
|
||||||
psIntfAdapter->bSuspended = TRUE;
|
psIntfAdapter->bSuspended = TRUE;
|
||||||
|
|
||||||
if(TRUE == psIntfAdapter->bPreparingForBusSuspend)
|
if(TRUE == psIntfAdapter->bPreparingForBusSuspend)
|
||||||
|
@ -735,33 +714,31 @@ static struct usb_driver usbbcm_driver = {
|
||||||
|
|
||||||
struct class *bcm_class;
|
struct class *bcm_class;
|
||||||
|
|
||||||
/*
|
|
||||||
Function: InterfaceInitialize
|
|
||||||
|
|
||||||
Description: This is the hardware specific initialization Function.
|
static __init int bcm_init(void)
|
||||||
Registering the driver with NDIS , other device specific NDIS
|
|
||||||
and hardware initializations are done here.
|
|
||||||
|
|
||||||
Input parameters: IN PMINI_ADAPTER Adapter - Miniport Adapter Context
|
|
||||||
|
|
||||||
|
|
||||||
Return: BCM_STATUS_SUCCESS - If Initialization of the
|
|
||||||
HW Interface was successful.
|
|
||||||
Other - If an error occured.
|
|
||||||
*/
|
|
||||||
INT InterfaceInitialize(void)
|
|
||||||
{
|
{
|
||||||
|
printk(KERN_INFO "%s: %s, %s\n", DRV_NAME, DRV_DESCRIPTION, DRV_VERSION);
|
||||||
|
printk(KERN_INFO "%s\n", DRV_COPYRIGHT);
|
||||||
|
|
||||||
bcm_class = class_create(THIS_MODULE, DRV_NAME);
|
bcm_class = class_create(THIS_MODULE, DRV_NAME);
|
||||||
if (IS_ERR(bcm_class)) {
|
if (IS_ERR(bcm_class)) {
|
||||||
printk(KERN_ERR DRV_NAME ": could not create class\n");
|
printk(KERN_ERR DRV_NAME ": could not create class\n");
|
||||||
return PTR_ERR(bcm_class);
|
return PTR_ERR(bcm_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
return usb_register(&usbbcm_driver);
|
return usb_register(&usbbcm_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT InterfaceExit(void)
|
static __exit void bcm_exit(void)
|
||||||
{
|
{
|
||||||
class_destroy (bcm_class);
|
class_destroy (bcm_class);
|
||||||
|
|
||||||
usb_deregister(&usbbcm_driver);
|
usb_deregister(&usbbcm_driver);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module_init(bcm_init);
|
||||||
|
module_exit(bcm_exit);
|
||||||
|
|
||||||
|
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||||
|
MODULE_VERSION(DRV_VERSION);
|
||||||
|
MODULE_LICENSE ("GPL");
|
||||||
|
|
|
@ -224,8 +224,6 @@ VOID Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cancel All submitted TX URB's */
|
/* Cancel All submitted TX URB's */
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cancelling All Submitted TX Urbs \n");
|
|
||||||
|
|
||||||
for(i = 0; i < MAXIMUM_USB_TCB; i++)
|
for(i = 0; i < MAXIMUM_USB_TCB; i++)
|
||||||
{
|
{
|
||||||
tempUrb = psIntfAdapter->asUsbTcb[i].urb;
|
tempUrb = psIntfAdapter->asUsbTcb[i].urb;
|
||||||
|
@ -236,9 +234,6 @@ VOID Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Cancelling All submitted Rx Urbs \n");
|
|
||||||
|
|
||||||
for(i = 0; i < MAXIMUM_USB_RCB; i++)
|
for(i = 0; i < MAXIMUM_USB_RCB; i++)
|
||||||
{
|
{
|
||||||
tempUrb = psIntfAdapter->asUsbRcb[i].urb;
|
tempUrb = psIntfAdapter->asUsbRcb[i].urb;
|
||||||
|
@ -249,16 +244,11 @@ VOID Bcm_kill_all_URBs(PS_INTERFACE_ADAPTER psIntfAdapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
atomic_set(&psIntfAdapter->uNumTcbUsed, 0);
|
atomic_set(&psIntfAdapter->uNumTcbUsed, 0);
|
||||||
atomic_set(&psIntfAdapter->uCurrTcb, 0);
|
atomic_set(&psIntfAdapter->uCurrTcb, 0);
|
||||||
|
|
||||||
atomic_set(&psIntfAdapter->uNumRcbUsed, 0);
|
atomic_set(&psIntfAdapter->uNumRcbUsed, 0);
|
||||||
atomic_set(&psIntfAdapter->uCurrRcb, 0);
|
atomic_set(&psIntfAdapter->uCurrRcb, 0);
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "TCB: used- %d cur-%d\n", atomic_read(&psIntfAdapter->uNumTcbUsed), atomic_read(&psIntfAdapter->uCurrTcb));
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "RCB: used- %d cur-%d\n", atomic_read(&psIntfAdapter->uNumRcbUsed), atomic_read(&psIntfAdapter->uCurrRcb));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID putUsbSuspend(struct work_struct *work)
|
VOID putUsbSuspend(struct work_struct *work)
|
||||||
|
@ -270,8 +260,6 @@ VOID putUsbSuspend(struct work_struct *work)
|
||||||
|
|
||||||
if(psIntfAdapter->bSuspended == FALSE)
|
if(psIntfAdapter->bSuspended == FALSE)
|
||||||
usb_autopm_put_interface(intf);
|
usb_autopm_put_interface(intf);
|
||||||
else
|
|
||||||
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL, "Interface Resumed Completely\n");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,34 +152,30 @@ VOID AdapterFree(PMINI_ADAPTER Adapter)
|
||||||
free_netdev(Adapter->dev);
|
free_netdev(Adapter->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int create_worker_threads(PMINI_ADAPTER psAdapter)
|
||||||
int create_worker_threads(PMINI_ADAPTER psAdapter)
|
|
||||||
{
|
{
|
||||||
const char *name = psAdapter->dev->name;
|
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Init Threads...");
|
|
||||||
// Rx Control Packets Processing
|
// Rx Control Packets Processing
|
||||||
psAdapter->control_packet_handler = kthread_run((int (*)(void *))
|
psAdapter->control_packet_handler = kthread_run((int (*)(void *))
|
||||||
control_packet_handler, psAdapter, "%s-rx", name);
|
control_packet_handler, psAdapter, "%s-rx", DRV_NAME);
|
||||||
if(IS_ERR(psAdapter->control_packet_handler))
|
if(IS_ERR(psAdapter->control_packet_handler))
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "No Kernel Thread, but still returning success\n");
|
pr_notice(DRV_NAME ": could not create control thread\n");
|
||||||
return PTR_ERR(psAdapter->control_packet_handler);
|
return PTR_ERR(psAdapter->control_packet_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tx Thread
|
// Tx Thread
|
||||||
psAdapter->transmit_packet_thread = kthread_run((int (*)(void *))
|
psAdapter->transmit_packet_thread = kthread_run((int (*)(void *))
|
||||||
tx_pkt_handler, psAdapter, "%s-tx", name);
|
tx_pkt_handler, psAdapter, "%s-tx", DRV_NAME);
|
||||||
if(IS_ERR (psAdapter->transmit_packet_thread))
|
if(IS_ERR (psAdapter->transmit_packet_thread))
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "No Kernel Thread, but still returning success");
|
pr_notice(DRV_NAME ": could not creat transmit thread\n");
|
||||||
kthread_stop(psAdapter->control_packet_handler);
|
kthread_stop(psAdapter->control_packet_handler);
|
||||||
return PTR_ERR(psAdapter->transmit_packet_thread);
|
return PTR_ERR(psAdapter->transmit_packet_thread);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct file *open_firmware_file(PMINI_ADAPTER Adapter, char *path)
|
||||||
static inline struct file *open_firmware_file(PMINI_ADAPTER Adapter, char *path)
|
|
||||||
{
|
{
|
||||||
struct file *flp=NULL;
|
struct file *flp=NULL;
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
|
@ -189,19 +185,13 @@ static inline struct file *open_firmware_file(PMINI_ADAPTER Adapter, char *path)
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
if(IS_ERR(flp))
|
if(IS_ERR(flp))
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable To Open File %s, err %lx",
|
pr_err(DRV_NAME "Unable To Open File %s, err %ld",
|
||||||
path, PTR_ERR(flp));
|
path, PTR_ERR(flp));
|
||||||
flp = NULL;
|
flp = NULL;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Got file descriptor pointer of %s!",
|
|
||||||
path);
|
|
||||||
}
|
|
||||||
if(Adapter->device_removed)
|
if(Adapter->device_removed)
|
||||||
{
|
|
||||||
flp = NULL;
|
flp = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
return flp;
|
return flp;
|
||||||
}
|
}
|
||||||
|
@ -254,9 +244,7 @@ exit_download:
|
||||||
if(flp && !(IS_ERR(flp)))
|
if(flp && !(IS_ERR(flp)))
|
||||||
filp_close(flp, current->files);
|
filp_close(flp, current->files);
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
do_gettimeofday(&tv);
|
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "file download done at %lx", ((tv.tv_sec * 1000) +
|
|
||||||
(tv.tv_usec/1000)));
|
|
||||||
return errorno;
|
return errorno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1104,11 +1092,10 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
|
||||||
* Firm/DDR Settings..
|
* Firm/DDR Settings..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if((status = create_worker_threads(ps_adapter))<0)
|
status = create_worker_threads(ps_adapter);
|
||||||
{
|
if (status<0)
|
||||||
BCM_DEBUG_PRINT(ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Cannot create thread");
|
|
||||||
return status;
|
return status;
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* For Downloading the Firm, parse the cfg file first.
|
* For Downloading the Firm, parse the cfg file first.
|
||||||
*/
|
*/
|
||||||
|
@ -1134,7 +1121,7 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
|
||||||
status = ddr_init(ps_adapter);
|
status = ddr_init(ps_adapter);
|
||||||
if(status)
|
if(status)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT (ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "ddr_init Failed\n");
|
pr_err(DRV_NAME "ddr_init Failed\n");
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1148,7 +1135,6 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
|
||||||
BCM_DEBUG_PRINT(ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Error downloading CFG file");
|
BCM_DEBUG_PRINT(ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Error downloading CFG file");
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
BCM_DEBUG_PRINT(ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "CFG file downloaded");
|
|
||||||
|
|
||||||
if(register_networkdev(ps_adapter))
|
if(register_networkdev(ps_adapter))
|
||||||
{
|
{
|
||||||
|
@ -1221,7 +1207,6 @@ int InitCardAndDownloadFirmware(PMINI_ADAPTER ps_adapter)
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(ps_adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "BIN file downloaded");
|
|
||||||
status = run_card_proc(ps_adapter);
|
status = run_card_proc(ps_adapter);
|
||||||
if(status)
|
if(status)
|
||||||
{
|
{
|
||||||
|
@ -1302,22 +1287,23 @@ void beceem_parse_target_struct(PMINI_ADAPTER Adapter)
|
||||||
|
|
||||||
if(ntohl(Adapter->pstargetparams->m_u32PhyParameter2) & AUTO_SYNC_DISABLE)
|
if(ntohl(Adapter->pstargetparams->m_u32PhyParameter2) & AUTO_SYNC_DISABLE)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "AutoSyncup is Disabled\n");
|
pr_info(DRV_NAME ": AutoSyncup is Disabled\n");
|
||||||
Adapter->AutoSyncup = FALSE;
|
Adapter->AutoSyncup = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "AutoSyncup is Enabled\n");
|
pr_info(DRV_NAME ": AutoSyncup is Enabled\n");
|
||||||
Adapter->AutoSyncup = TRUE;
|
Adapter->AutoSyncup = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ntohl(Adapter->pstargetparams->HostDrvrConfig6) & AUTO_LINKUP_ENABLE)
|
if(ntohl(Adapter->pstargetparams->HostDrvrConfig6) & AUTO_LINKUP_ENABLE)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Enabling autolink up");
|
pr_info(DRV_NAME ": Enabling autolink up");
|
||||||
Adapter->AutoLinkUp = TRUE;
|
Adapter->AutoLinkUp = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Disabling autolink up");
|
pr_info(DRV_NAME ": Disabling autolink up");
|
||||||
Adapter->AutoLinkUp = FALSE;
|
Adapter->AutoLinkUp = FALSE;
|
||||||
}
|
}
|
||||||
// Setting the DDR Setting..
|
// Setting the DDR Setting..
|
||||||
|
@ -1326,51 +1312,46 @@ void beceem_parse_target_struct(PMINI_ADAPTER Adapter)
|
||||||
Adapter->ulPowerSaveMode =
|
Adapter->ulPowerSaveMode =
|
||||||
(ntohl(Adapter->pstargetparams->HostDrvrConfig6)>>12)&0x0F;
|
(ntohl(Adapter->pstargetparams->HostDrvrConfig6)>>12)&0x0F;
|
||||||
|
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "DDR Setting: %x\n", Adapter->DDRSetting);
|
pr_info(DRV_NAME ": DDR Setting: %x\n", Adapter->DDRSetting);
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT,DBG_LVL_ALL, "Power Save Mode: %lx\n",
|
pr_info(DRV_NAME ": Power Save Mode: %lx\n", Adapter->ulPowerSaveMode);
|
||||||
Adapter->ulPowerSaveMode);
|
|
||||||
if(ntohl(Adapter->pstargetparams->HostDrvrConfig6) & AUTO_FIRM_DOWNLOAD)
|
if(ntohl(Adapter->pstargetparams->HostDrvrConfig6) & AUTO_FIRM_DOWNLOAD)
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Enabling Auto Firmware Download\n");
|
pr_info(DRV_NAME ": Enabling Auto Firmware Download\n");
|
||||||
Adapter->AutoFirmDld = TRUE;
|
Adapter->AutoFirmDld = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Disabling Auto Firmware Download\n");
|
pr_info(DRV_NAME ": Disabling Auto Firmware Download\n");
|
||||||
Adapter->AutoFirmDld = FALSE;
|
Adapter->AutoFirmDld = FALSE;
|
||||||
}
|
}
|
||||||
uiHostDrvrCfg6 = ntohl(Adapter->pstargetparams->HostDrvrConfig6);
|
uiHostDrvrCfg6 = ntohl(Adapter->pstargetparams->HostDrvrConfig6);
|
||||||
Adapter->bMipsConfig = (uiHostDrvrCfg6>>20)&0x01;
|
Adapter->bMipsConfig = (uiHostDrvrCfg6>>20)&0x01;
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"MIPSConfig : 0x%X\n",Adapter->bMipsConfig);
|
pr_info(DRV_NAME ": MIPSConfig : 0x%X\n",Adapter->bMipsConfig);
|
||||||
//used for backward compatibility.
|
//used for backward compatibility.
|
||||||
Adapter->bDPLLConfig = (uiHostDrvrCfg6>>19)&0x01;
|
Adapter->bDPLLConfig = (uiHostDrvrCfg6>>19)&0x01;
|
||||||
|
|
||||||
Adapter->PmuMode= (uiHostDrvrCfg6 >> 24 ) & 0x03;
|
Adapter->PmuMode= (uiHostDrvrCfg6 >> 24 ) & 0x03;
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "PMU MODE: %x", Adapter->PmuMode);
|
pr_info(DRV_NAME ": PMU MODE: %x", Adapter->PmuMode);
|
||||||
|
|
||||||
if((uiHostDrvrCfg6 >> HOST_BUS_SUSPEND_BIT ) & (0x01))
|
if((uiHostDrvrCfg6 >> HOST_BUS_SUSPEND_BIT ) & (0x01))
|
||||||
{
|
{
|
||||||
Adapter->bDoSuspend = TRUE;
|
Adapter->bDoSuspend = TRUE;
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Making DoSuspend TRUE as per configFile");
|
pr_info(DRV_NAME ": Making DoSuspend TRUE as per configFile");
|
||||||
}
|
}
|
||||||
|
|
||||||
uiEEPROMFlag = ntohl(Adapter->pstargetparams->m_u32EEPROMFlag);
|
uiEEPROMFlag = ntohl(Adapter->pstargetparams->m_u32EEPROMFlag);
|
||||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "uiEEPROMFlag : 0x%X\n",uiEEPROMFlag);
|
pr_info(DRV_NAME ": uiEEPROMFlag : 0x%X\n",uiEEPROMFlag);
|
||||||
Adapter->eNVMType = (NVM_TYPE)((uiEEPROMFlag>>4)&0x3);
|
Adapter->eNVMType = (NVM_TYPE)((uiEEPROMFlag>>4)&0x3);
|
||||||
|
|
||||||
|
|
||||||
Adapter->bStatusWrite = (uiEEPROMFlag>>6)&0x1;
|
Adapter->bStatusWrite = (uiEEPROMFlag>>6)&0x1;
|
||||||
//printk(("bStatusWrite : 0x%X\n", Adapter->bStatusWrite));
|
|
||||||
|
|
||||||
Adapter->uiSectorSizeInCFG = 1024*(0xFFFF & ntohl(Adapter->pstargetparams->HostDrvrConfig4));
|
Adapter->uiSectorSizeInCFG = 1024*(0xFFFF & ntohl(Adapter->pstargetparams->HostDrvrConfig4));
|
||||||
//printk(("uiSectorSize : 0x%X\n", Adapter->uiSectorSizeInCFG));
|
|
||||||
|
|
||||||
Adapter->bSectorSizeOverride =(bool) ((ntohl(Adapter->pstargetparams->HostDrvrConfig4))>>16)&0x1;
|
Adapter->bSectorSizeOverride =(bool) ((ntohl(Adapter->pstargetparams->HostDrvrConfig4))>>16)&0x1;
|
||||||
//printk(MP_INIT,("bSectorSizeOverride : 0x%X\n",Adapter->bSectorSizeOverride));
|
|
||||||
|
|
||||||
if(ntohl(Adapter->pstargetparams->m_u32PowerSavingModeOptions) &0x01)
|
if(ntohl(Adapter->pstargetparams->m_u32PowerSavingModeOptions) &0x01)
|
||||||
Adapter->ulPowerSaveMode = DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE;
|
Adapter->ulPowerSaveMode = DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE;
|
||||||
//autocorrection part
|
|
||||||
if(Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE)
|
if(Adapter->ulPowerSaveMode != DEVICE_POWERSAVE_MODE_AS_PROTOCOL_IDLE_MODE)
|
||||||
doPowerAutoCorrection(Adapter);
|
doPowerAutoCorrection(Adapter);
|
||||||
|
|
||||||
|
@ -1378,7 +1359,7 @@ void beceem_parse_target_struct(PMINI_ADAPTER Adapter)
|
||||||
|
|
||||||
VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
|
VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
|
||||||
{
|
{
|
||||||
UINT reporting_mode = 0;
|
UINT reporting_mode;
|
||||||
|
|
||||||
reporting_mode = ntohl(psAdapter->pstargetparams->m_u32PowerSavingModeOptions) &0x02 ;
|
reporting_mode = ntohl(psAdapter->pstargetparams->m_u32PowerSavingModeOptions) &0x02 ;
|
||||||
psAdapter->bIsAutoCorrectEnabled = !((char)(psAdapter->ulPowerSaveMode >> 3) & 0x1);
|
psAdapter->bIsAutoCorrectEnabled = !((char)(psAdapter->ulPowerSaveMode >> 3) & 0x1);
|
||||||
|
@ -1395,7 +1376,6 @@ VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
|
||||||
{
|
{
|
||||||
psAdapter->ulPowerSaveMode = DEVICE_POWERSAVE_MODE_AS_PMU_CLOCK_GATING;
|
psAdapter->ulPowerSaveMode = DEVICE_POWERSAVE_MODE_AS_PMU_CLOCK_GATING;
|
||||||
psAdapter->bDoSuspend =FALSE;
|
psAdapter->bDoSuspend =FALSE;
|
||||||
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"PMC selected..");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,6 @@ VOID AdapterFree(PMINI_ADAPTER Adapter);
|
||||||
|
|
||||||
INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter);
|
INT FreeAdapterDsxBuffer(PMINI_ADAPTER Adapter);
|
||||||
|
|
||||||
int create_worker_threads(PMINI_ADAPTER psAdapter);
|
|
||||||
|
|
||||||
int tx_pkt_handler(PMINI_ADAPTER Adapter);
|
int tx_pkt_handler(PMINI_ADAPTER Adapter);
|
||||||
|
|
||||||
int reset_card_proc(PMINI_ADAPTER Adapter );
|
int reset_card_proc(PMINI_ADAPTER Adapter );
|
||||||
|
|
Loading…
Add table
Reference in a new issue