dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

349 Commits

Author SHA1 Message Date
Stephen Hemminger 9e0a3169a3 beceem: create class on module installation
First step to supporting multiple devices, create device class
when module is initialized.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:24:16 -04:00
Stephen Hemminger 46c3790eb5 beceem: convert to kernel coding style
Change indentation etc, to conform to acceptable kernel style

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:16:29 -04:00
Stephen Hemminger 5afb5145a1 beceem: remove useless debug function entry messages
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:07:20 -04:00
Stephen Hemminger 957ea3b570 beceem: remove problematic debug print messages
Not worth bothering to change printf format of messages which
are basically noise.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:05:34 -04:00
Stephen Hemminger 032100f652 beceem: remove unnecessary usb class
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 10:03:29 -04:00
Stephen Hemminger ada692b09f beceem: fix character device ioctl
Sparse caught several places where ioctl interface was incorrectly using user
memory. Fix all the ioctl cases for casting and __user annotation.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:55:08 -04:00
Stephen Hemminger c5ebe2278b beceem: fix printf format strings
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:53 -04:00
Stephen Hemminger 0980f2e814 beceem: reserve one queue for bit-bucket
This preserves the semantics of the original driver (unclassified packets
are dropped), but does it in a clean way; and fixes crash when packet
is sent to offline device.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:47 -04:00
Stephen Hemminger 3644c1a2f1 beceem: remove dead code
Remove commented out with '#if 0'

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:43 -04:00
Stephen Hemminger 9371105816 beceem: support multiple queues
Current kernels have multi-queue support which can be used by
this device. This has the advantage that a single type of traffic
will not block other types.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:39 -04:00
Stephen Hemminger 20f48653fc beceem: get rid of unnecessary inline usage
Many routines were tagged with inline_ but GCC does a better
job of deciding this.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:35 -04:00
Stephen Hemminger 26a0e39ac8 beceem: fold unregister_netdevice into AdapterFree
The function unregister_netdevice only called unregister_netdev.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:54:31 -04:00
Stephen Hemminger 7441698fe9 beceem: remove ARP spoofing
Linux support NOARP flag, so the whole Arp spoofing routines
are not needed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:53:58 -04:00
Stephen Hemminger 6ba8fe77dd beceem: print better message on bad ioctl
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:52:42 -04:00
Stephen Hemminger e614e28eac beceem: remove indirection to Adapter structure
Allocate Adapter structure as part of network device.

Signed-off-by: Stephen Hemminber <shemminger@vyatta.com>
2010-11-01 09:52:14 -04:00
Stephen Hemminger 2515ab628f beceem: Add proper carrier and link management
Start with carrier off.
Don't track up/down status in driver private flag.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:29 -04:00
Stephen Hemminger d7affd0f58 beceem: reduce transmit queue len
Reduce transmit queue length to avoid excess buffering

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:23 -04:00
Stephen Hemminger 9c6e9aa830 beceem: remove dead code
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:16 -04:00
Stephen Hemminger d21d6dde02 beceem: add ethtool support
This adds basic ethtool support to get driver info and settings

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:50:06 -04:00
Stephen Hemminger 71e253b169 beceem: make transmit thread interruptible
Kernel complains loudly if thread does long uninterruptible sleep.
Also, dont wake up every 10ms even if no data present (wastes power).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:49:30 -04:00
Stephen Hemminger de85f98589 beceem: name threads with device name
This is the convention used by Intel Wimax

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:42:56 -04:00
Stephen Hemminger 082e889b47 beceem: remove OS wrapper library
Use native kernel functions for kmalloc/kfree directly

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:35:21 -04:00
Stephen Hemminger c5113e3c11 beceem: use kernel print_hex_dump function
No longer need special hex dump routine

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-11-01 09:30:59 -04:00
Stephen Hemminger 0ad008fcbc beceem: cleanup network device setup
Change how network device is setup:
* set pointer to device object so sysfs has eth0/device symlink
* set network device type
* eliminate all the compatiablity with older kernels.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:45:12 -07:00
Stephen Hemminger 92bc60580e beceem: get rid of OS dependent data structure
The only part of this structure still used was the network
device stats, and in recent kernel these are available in
network device itself.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:45:01 -07:00
Stephen Hemminger 2b5e625882 beceem: eliminate dead code
Get rid of empty header file and unused declarations

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:57 -07:00
Stephen Hemminger d52db0b4b3 beceem: eliminate network registered state variable
Just use presence of pointer

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:52 -07:00
Stephen Hemminger 3705a843bd beceem: remove bogus network device notifier
Network device should not be messing with refcounts directly.
See Documentation/networking/netdevices.txt

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:47 -07:00
Stephen Hemminger 2564a148d5 beceem: cleanup debug level infrastructure
Add module parameter to control debug level and do code cleanup
The whole debug stuff should eventually be removed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:44:41 -07:00
Stephen Hemminger 047a5f2b50 beceem: eliminate unused USB stubs
USB layer does not require these reset function stubs

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:37 -07:00
Stephen Hemminger 5abe61ade9 beceem: remove version ifdef's
Remove code to support older kernel API's

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:32 -07: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 2e44f765df beceem: add module information
Add description and version information to the driver.
Make USB device table exported as alias so device will be
autoloaded. Get rid of useless noise message on boot.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2010-10-29 20:43:23 -07:00
Greg Kroah-Hartman eebfc6055a Staging: bcm: fix up network device reference counting
The way network devices are reference counted does not include poking
around in the reference count itself.  This breaks when the reference
count is changed to be a different type.  Fix the driver to do the
proper function calls instead.

Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28 09:54:23 -07:00
Dan Carpenter 370adc7cb0 Staging: bcm: silence off by one warning
"status" is used as an index into the Adapter->PackInfo[] array, which
has NO_OF_QUEUES elements.

This code actually works OK.  The SearchSfid() function always returns
a valid index or it returns NO_OF_QUEUES + 1.  But it looks sloppy and
it makes the static checkers complain.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:57 -07:00
Dan Carpenter 02339374cf Staging: bcm: remove unneeded NULL check
The error handling here is wrong.  If psIntfAdapter were NULL then we
would have a NULL dereference in the debug output on the error path.
But this function is only called from usbbcm_device_probe() when
psIntfAdapter is non-NULL.

Since the check isn't needed and I removed it instead of fixing it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:56 -07:00
Dan Carpenter ef5d205645 Staging: bcm: return -EFAULT on copy_to_user() errors
bcm/InterfaceDld.c had a couple places which returned the number of
bytes remaining instead of -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:56 -07:00
Dan Carpenter acedadfae5 Staging: bcm: dereferencing before checking
I moved the check to see if "Adapter" was null in front of the
dereference.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:55 -07:00
Dan Carpenter 055a1eda5f Staging: bcm: mocro expansion bug
The WIMAX_MAX_MTU macro is used in drivers/staging/bcm/CmHost.c like
this:

    if (Adapter->PackInfo[uiSearchRuleIndex].uiMaxBucketSize < WIMAX_MAX_MTU * 8)

The multiplication by eight has precedence over the addition so the
macro needs parenthesis to work.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:55 -07:00
Dan Carpenter 785698e38d Staging: bcm: make major and minor signed
We assume that major is signed in register_control_device_interface().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:54 -07:00
Dan Carpenter bf58bd66f6 Staging: bcm: return -EFAULT on copy_to_user() failures
There were a number of places in the bcm_char_ioctl() which returned the
number of bytes remaining to be copied instead of returning -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:29:54 -07:00
Tracey Dent 9a837af5fb Staging: bcm: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:52 -07:00
Arnd Bergmann 44a17eff84 staging/bcm: add sparse annotations
This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.

The rest is mostly about marking functions static when they
are only used in one file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:15 -07:00
Arnd Bergmann 9f1c75ac2d staging/bcm: fix most build warnings
This removes all warnings I get on a 64 bit build except
for those that look unfixable, where we convert a pointer
to a 32 bit integer and change its byte order!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:15 -07:00
Arnd Bergmann d16044cf8c staging: make new character devices nonseekable
As a preparation for changing the default behaviour of llseek to no_llseek,
every file_operations structure should have a .llseek operation.

There are three new instances in staging now, which can all be changed
into no_llseek explicitly since the devices do not need to seek.

Add nonseekable_open where appropriate, to prevent pread/pwrite as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 08:50:14 -07:00
Joe Perches 03a6cddbb8 staging: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 13:02:37 -07:00
Randy Dunlap 5fe1f1edb9 staging/bcm: fix build for CONFIG_PM not enabled
Handle build case of CONFIG_PM not being enabled.

drivers/staging/bcm/InterfaceInit.c:280: error: 'struct usb_device' has no member named 'autosuspend_delay'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -07:00
Randy Dunlap 3e8acee461 staging/bcm: fix printk format warnings
Fix lots of printk format warnings in bcm.  Here is a sample of them:

drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-16 12:29:32 -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