| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
| |
The timeout argument is in microseconds, not in jiffies. Use
USB_CTRL_GET_TIMEOUT in all usb_control_msg() calls. It's 5 seconds,
and should be enough even for the slowest devices.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Use AT76_TX_HDRLEN in one place where it wasn't used.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
| |
They make it harder to check correctness of MIB requests. For instance,
STATION_ID_OFFSET doesn't show that it's an offset in struct
mib_mac_mgmt, so it's not obvious if priv->mib_buf.type is set to
MIB_MAC_MGMT correctly.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
| |
Don't assume that there are just two settings, "long" and "short".
Provide textual description in the output of "iwpriv get_preamble" in
the same format as in ipw2100 and ipw2200.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
| |
Rename all iwpriv calls to start with "get" or "set" for consistency.
Eliminate gap in the ioctl numbers.
Rename "intl_roaming" to "intl_scan", because it's really affects
scanning only.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
usb_make_path() is used to construct stable device path. This is used
in other USB based network drivers.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
This way, /sys/class/net/ethX/device/driver points to at76_usb driver
rather than usb driver. This is consistent with other network drivers.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Never use __FILE__, as it prints full path to the driver, which is
rarely needed. Use DRIVER_NAME instead.
Replace all occurrences of info() with printk() calls. Ensure that the
messages are properly formatted and use the netdevice name if possible.
Print MAC address, firmware version and regulatory domain after the
device is registered, so we can provide the device name.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Calculate the pipe numbers on startup and keep them in at76_priv instead
of keeping the endpoint numbers. Pipe numbers don't change.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Intervene in some places to make the result readable
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Avoid using two tertiary operators in one expression.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
This avoids extra long lines and makes the code survive Lindent without
getting ugly.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Lindent converts them to single newlines
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use rotating buffer pool in mac2str() and hex2str(). This makes it
unnecessary to allocate any buffers for either function, and also allows
to use mac2str() more than once in the same expression. Move mac2str()
and hex2str() closer together.
Replace hex2str() with mac2str() where appropriate. For other hex2str()
calls, always use "-" separator to improve readability. Check buffer
length in hex2str().
Reformat some expressions along the way.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove all Linux 2.6.21 compatibility from the driver - it shouldn't be
there for kernel submission. Move all compatibility code to a separate
file compat.h. Include it forcedly with the "-include" option. Add
a makefile option to disable config.h inclusion.
Provide compatibility as far back as Linux 2.6.19 - it's not really hard
once the infrastructure is in place.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Module parameters are not well suited for device-specific settings.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Scheduling is done in process context, so it can be avoided. Merge
at76_work_start_ibss() into at76_start_ibss().
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
This reduces driver's dependency on USB internals.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move all firmware related data from struct at76_priv to struct fwentry.
Move struct fwentry to the header file. Share the firmware data between
devices.
Never load firmware version or anything else into firmwares[], as one
broken device can mess it for others. Use temporary structures instead.
Change at76_load_internal_fw() and at76_load_external_fw() not to
require struct at76_priv, which is allocated as part of the network
device. at76_disconnect() should check if priv is allocated.
Don't use priv->istate to track the firmware loading, as it's done in a
predictable consecutive manner now. No state machine is needed at this
point. There should be no priv at all before the firmware is loaded.
Until the device is fully initialized, priv->istate should be INIT.
Don't use mutexes during firmware download for the same reason. In
fact, they were used incorrectly since priv is not the same during
internal and external firmware download.
Parse firmware immediately after loading in a new function
at76_load_firmware() replacing at76_parse_fw() and parts of
at76_probe().
Don't access udev before usb_get_dev() is called and be careful to call
usb_put_dev() for all errors.
Improve error handling and diagnostics in the affected code.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Don't use management timer in monitor mode, it's not needed. All that's
needed is to read the status from CMD_SCAN. Remove monitor mode support
from at76_handle_mgmt_timeout_scan(), reorganize the logic to reduce
indentation.
Split at76_start_monitor() from at76_start_scan().
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
| |
Perhaps it was intended for some kind of "fixed up" monitor mode, but
the code has no chance to be executed since the monitor mode consumes
the packets before this point.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Manually adjust some comments, remove excessive newlines inside
functions.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
| |
at76_set_monitor_mode() is always called after at76_startup_device(),
and other at76_set functions are called from at76_startup_device()
directly. Move at76_set_monitor_mode() closer to the other at76_set
functions.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
| |
This should be implemented by the userspace. No other Linux driver does
that. The expected behavior is that the driver stays on the same
channel while in monitor mode.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
While at that, improve the affected comments.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
at76_start_scan was both a function and a structure. Use "req" in the
structure names to indicate that they are requests.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
The later was just a trivial wrapper.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Now the driver doesn't crash the kernel if the firmware is present but
invalid.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
It's more readable than using two statements.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Timers are justified if they are scheduled in the interrupt context or
if they are modified. Neither is the case.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
| |
at76_probe() is run in the process context and doesn't need to delay the
firmware download. Rescheduling doesn't guarantee the execution order,
so it's better to make the order predictable. It also makes it possible
to handle errors in the firmware download.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not doing so causes circular mutex dependency, which is detected by the
kernel lock validation code The driver's mutex should only protect
hardware access and driver's structures, and should not be held when
dealing with higher layers of the kernel.
The locking and the initialization may need a serious overhaul, but this
little change is a step in the right direction.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
We should not treat negative errno like positive valid modes.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Keep 2.6.21 compatibility for now. Use SKB_WITH_OVERHEAD as an
indicator of the new API, since the kernel is not called 2.6.22 yet.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
| |
Semaphores are overkill for simple locking.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
| |
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
| |
Always use two newlines between functions. Re-format some function
declatrations.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use a structure to describe the firmware header. Don't pass any
arguments fpr output, just pass the pointer to the private data. Move
some debugging output there to avoid code duplication.
Parse firmware even if it doesn't need to be loaded. Keep firmware
version information in the private data. It's still re-read from the
card, but now we have a valid version earlier.
Signed-off-by: Pavel Roskin <proski@gnu.org>
|