Commit Graph

13 Commits

Author SHA1 Message Date
Jade Bilkey c6e50bafd0 staging: bcm: Cleanup unneeded boolean comparisons
Cleans up a few needless comparisons with booleans and cleans up an
interupt handler to take advantage of earlier bailout shortcircuit.

Signed-off-by: Jade Bilkey <herself@thefumon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:48:42 -07:00
Jade Bilkey 6a259d9b7b staging: bcm: Cleanup CreateInterruptUrb() and StartInterruptUrb()
Fixes checkpatch.pl warnings and errors:

ERROR: that open brace { should be on the previous line
+	if (!psIntfAdapter->psInterruptUrb)
+	{

WARNING: line over 80 characters
+		BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot allocate interrupt urb");

ERROR: space required after that ',' (ctx:VxV)
+		BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot allocate interrupt urb");
 		                                        ^

ERROR: space required after that ',' (ctx:VxV)
+		BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot allocate interrupt urb");
 		                                                                                ^

WARNING: line over 80 characters
+								psIntfAdapter->ulInterruptData;

WARNING: line over 80 characters
+							sizeof(psIntfAdapter->ulInterruptData);

WARNING: line over 80 characters
+						psIntfAdapter->sIntrIn.int_in_endpointAddr);

WARNING: line over 80 characters
+					psIntfAdapter->psInterruptUrb->transfer_buffer,

WARNING: line over 80 characters
+					psIntfAdapter->psInterruptUrb->transfer_buffer_length,

WARNING: line over 80 characters
+	BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt Interval: %d\n",

ERROR: space required after that ',' (ctx:VxV)
+	BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt Interval: %d\n",
 	                                        ^

ERROR: space required after that ',' (ctx:VxV)
+	BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt Interval: %d\n",
 	                                                                                ^

ERROR: that open brace { should be on the previous line
+	if( false == psIntfAdapter->psAdapter->device_removed &&
+		false == psIntfAdapter->psAdapter->bEndPointHalted &&
+		false == psIntfAdapter->bSuspended &&
+		false == psIntfAdapter->bPreparingForBusSuspend &&
+		false == psIntfAdapter->psAdapter->StopAllXaction)
+	{

ERROR: space prohibited after that open parenthesis '('
+	if( false == psIntfAdapter->psAdapter->device_removed &&

ERROR: space required before the open parenthesis '('
+	if( false == psIntfAdapter->psAdapter->device_removed &&

WARNING: line over 80 characters
+		status = usb_submit_urb(psIntfAdapter->psInterruptUrb, GFP_ATOMIC);

ERROR: that open brace { should be on the previous line
+		if (status)
+		{

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot send int urb %d\n", status);

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot send int urb %d\n", status);
 			                                        ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Cannot send int urb %d\n", status);
 			                                                                                ^

ERROR: that open brace { should be on the previous line
+			if(status == -EPIPE)
+			{

ERROR: space required before the open parenthesis '('
+			if(status == -EPIPE)

WARNING: line over 80 characters
+				psIntfAdapter->psAdapter->bEndPointHalted = TRUE ;

WARNING: space prohibited before semicolon
+				psIntfAdapter->psAdapter->bEndPointHalted = TRUE ;

WARNING: line over 80 characters
+				wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);

Signed-off-by: Jade Bilkey <herself@thefumon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:48:42 -07:00
Jade Bilkey 94e74333d0 staging: bcm: Cleanup switch statement
Fixes checkpatch.pl warnings and errors:

ERROR: switch and case should be at the same indent
+	switch (status) {
[...]
+	    case STATUS_SUCCESS:
[...]
+		case -ENOENT :
[...]
+		case -EINPROGRESS:
[...]
+		case -EPIPE:
[...]
+	    case -ECONNRESET: //URB got unlinked.
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.
[...]
+	    case -ENODEV : //Device got removed
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.
[...]
+	    default:

ERROR: that open brace { should be on the previous line
+		if ( urb->actual_length )
+		{

ERROR: space prohibited after that open parenthesis '('
+		if ( urb->actual_length )

ERROR: space prohibited before that close parenthesis ')'
+		if ( urb->actual_length )

ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF)

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");
 				                       ^
ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF00)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF00)

WARNING: line over 80 characters
+					(psIntfAdapter->ulInterruptData[1] & 0xFF00) >> 8);

WARNING: space prohibited between function name and open parenthesis '('
+				atomic_set (&Adapter->uiMBupdate, TRUE);

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",
 				                       ^
+					atomic_read(&Adapter->CurrNumFreeTxDesc));

ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] >> 16)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] >> 16)

ERROR: spaces required around that '=' (ctx:VxE)
+				Adapter->CurrNumRecvDescs=
 				                         ^

WARNING: line over 80 characters
+					(psIntfAdapter->ulInterruptData[1]  >> 16);
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
 				                       ^

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
 				                                                               ^

ERROR: that open brace { should be on the previous line
+			if(Adapter->fw_download_done &&
+				!Adapter->downloadDDR &&
+				atomic_read(&Adapter->CurrNumFreeTxDesc))
+			{

ERROR: space required before the open parenthesis '('
+			if(Adapter->fw_download_done &&

ERROR: spaces required around that '+=' (ctx:WxV)
+				psIntfAdapter->psAdapter->downloadDDR +=1;
 				                                      ^

ERROR: that open brace { should be on the previous line
+			if(false == Adapter->waiting_to_fw_download_done)
+			{

ERROR: space required before the open parenthesis '('
+			if(false == Adapter->waiting_to_fw_download_done)

ERROR: that open brace { should be on the previous line
+			if(!atomic_read(&Adapter->TxPktAvail))
+			{

ERROR: space required before the open parenthesis '('
+			if(!atomic_read(&Adapter->TxPktAvail))

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");
 			                                                               ^

ERROR: space prohibited before that ':' (ctx:WxE)
+		case -ENOENT :
 		             ^

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");
 			                                                               ^

WARNING: space prohibited before semicolon
+			return ;

WARNING: line over 80 characters
+			//This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation.

ERROR: do not use C99 // comments
+			//This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation.

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");
 			                                                               ^

WARNING: space prohibited before semicolon
+			break ;

ERROR: do not use C99 // comments
+			//return;

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");
 				                       ^

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");
 				                                                               ^

WARNING: space prohibited before semicolon
+				Adapter->bEndPointHalted = TRUE ;

WARNING: space prohibited before semicolon
+				urb->status = STATUS_SUCCESS ;

ERROR: do not use C99 // comments
+	    case -ECONNRESET: //URB got unlinked.

WARNING: line over 80 characters
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.

ERROR: do not use C99 // comments
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.

WARNING: line over 80 characters
+	    						//Occurs only when something happens with the host controller device

ERROR: code indent should use tabs where possible
+^I    ^I^I^I^I^I^I//Occurs only when something happens with the host controller device$

WARNING: please, no space before tabs
+^I    ^I^I^I^I^I^I//Occurs only when something happens with the host controller device$

ERROR: do not use C99 // comments
+	    						//Occurs only when something happens with the host controller device

ERROR: do not use C99 // comments
+	    case -ENODEV : //Device got removed

ERROR: space prohibited before that ':' (ctx:WxW)
+	    case -ENODEV : //Device got removed
 	                 ^

WARNING: line over 80 characters
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.

ERROR: do not use C99 // comments
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.

ERROR: space prohibited before that ':' (ctx:WxW)
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.
 		             ^

WARNING: line over 80 characters
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);

ERROR: code indent should use tabs where possible
+^I    ^IBCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);$

WARNING: please, no space before tabs
+^I    ^IBCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);$

ERROR: space required after that ',' (ctx:VxV)
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);
 	    	                       ^

ERROR: space required after that ',' (ctx:VxV)
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);
 	    	                                                               ^

WARNING: space prohibited before semicolon
+			urb->status = STATUS_SUCCESS ;

WARNING: space prohibited before semicolon
+			break ;

ERROR: do not use C99 // comments
+			//return;

ERROR: spaces required around that ':' (ctx:VxE)
+	    default:
 	           ^

WARNING: line over 80 characters
+			//This is required to check what is the defaults conditions when it occurs..

ERROR: do not use C99 // comments
+			//This is required to check what is the defaults conditions when it occurs..

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);
 			                                                           ^
Signed-off-by: Jade Bilkey <herself@thefumon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:48:42 -07:00
Jade Bilkey 54585d5e4c staging: bcm: Cleanup real_int_callback()
Fixes checkpatch.pl warnings and errors and removes some dead code.

Checkpath warnings and errors fixed:

WARNING: line over 80 characters
WARNING: space prohibited before semicolon

ERROR: that open brace { should be on the previous line
ERROR: space required before the open parenthesis '('
ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Jade Bilkey <herself@thefumon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:48:42 -07:00
Lisa Nguyen f70c8a91cd staging: bcm: Replace FALSE with false
Replace user-defined type FALSE with C defined false keyword.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 14:13:46 -07:00
Kevin McKinney d6861cfef2 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>
2012-11-02 11:36:46 -07:00
Kevin McKinney 2979460d7a Staging: bcm: Remove typedef for _MINI_ADAPTER and call directly.
This patch removes typedef for _MINI_ADAPTER, changes the
name of the struct from _MINI_ADAPTER to bcm_mini_adapter.
In addition, any calls to the following typedefs
"MINI_ADAPTER, *PMINI_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>
2012-06-04 21:09:22 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Joe Perches 859171ca92 drivers/staging: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Stephen Hemminger 9dd47ee7dd beceem: make local functions static
Use namespace tool from kernel scripts to identify dead code and
functions that should be static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:37:05 -04:00
Stephen Hemminger 9ec4475bf1 beceem: debug message format changes
Add more debug messages and make them similar to other drivers

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 12:18:36 -04:00
Stephen Hemminger 91d29ee1a8 beceem: remove ifdef's
There were a lot of ifdef's for driver options which have no
configuration options.  Choose the current value and remove the
ifdef.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:28 -07:00
Stephen Hemminger f8942e07a3 staging: Beeceem USB Wimax driver
The Sprint 4G network uses a Wimax dongle with Beecem
chipset. The driver is typical of out of tree drivers, but
maybe useful for people, and the hardware is readily available.

Here is a staging ready version (i.e warts and all)

0. Started with Rel_5.2.7.3P1_USB from Sprint4GDeveloperPack-1.1
1. Consolidated files in staging
2. Remove Dos cr/lf
3. Remove unnecessary ioctl from usbbcm_fops

Applied patches that were in the developer pack, surprising
there were ones for 2.6.35 already.

This is compile tested only, see TODO for what still needs
to be done.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-08 21:15:06 -07:00