[PATCH] libertas: reorganize and simplify init sequence

This patch moves all firmware load responsibility into the interface-specific
code and gets rid of the firmware pointer in the generic card structure.  It
also removes 3 fairly unecessary callbacks: hw_register_dev, hw_unregister_dev,
and hw_prog_firmware.  It also makes the init sequence from interface
probe functions more logical, as there are paired add/remove and start/stop
calls into generic libertas code.

Because the USB driver code uses the same TX URB callback for both firmware
upload (where the generic libertas structure isn't initialized yet) and for
normal operation (where it is), some bits of USB code have to deal with
'priv' being NULL.  All USB firmware upload bits have been changed to not
require 'priv' at all, but simply the USB card structure.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Dan Williams
2007-08-20 11:43:25 -04:00
committed by David S. Miller
parent b1b1907dce
commit 954ee164f4
6 changed files with 367 additions and 534 deletions

View File

@@ -72,8 +72,9 @@ void libertas_send_iwevcustom_event(wlan_private * priv, s8 * str);
struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band,
int *cfp_no);
wlan_private *libertas_add_card(void *card, struct device *dmdev);
int libertas_activate_card(wlan_private *priv);
int libertas_remove_card(wlan_private *priv);
int libertas_start_card(wlan_private *priv);
int libertas_stop_card(wlan_private *priv);
int libertas_add_mesh(wlan_private *priv, struct device *dev);
void libertas_remove_mesh(wlan_private *priv);
int libertas_reset_device(wlan_private *priv);