aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_chip.h
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-07-01 13:22:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-07-10 14:14:56 -0400
commit74553aedd46b3a2cae986f909cf2a3f99369decc (patch)
tree6904945b36c017c58249b1900fbbd531f3286e49 /drivers/net/wireless/zd1211rw/zd_chip.h
parent93f510bbac64f552ef6872a39ae12afa06c4e999 (diff)
[PATCH] zd1211rw: Defer firmware load until first ifup
While playing with the firmware a while back, I discovered a way to access the device's entire address space before the firmware has been loaded. Previously we were loading the firmware early on (during probe) so that we could read the MAC address from the EEPROM and register a netdevice. Now that we can read the EEPROM without having firmware, we can defer firmware loading until later while still reading the MAC address early on. This has the advantage that zd1211rw can now be built into the kernel -- previously if this was the case, zd1211rw would be loaded before the filesystem is available and firmware loading would fail. Firmware load and other device initialization operations now happen the first time the interface is brought up. Some architectural changes were needed: handling of the is_zd1211b flag was moved into the zd_usb structure, MAC address handling was obviously changed, and a preinit_hw stage was added (the order is now: init, preinit_hw, init_hw). Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_chip.h')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
index 79d0288c193a..f4698576ab71 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.h
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -704,7 +704,6 @@ struct zd_chip {
704 struct mutex mutex; 704 struct mutex mutex;
705 /* Base address of FW_REG_ registers */ 705 /* Base address of FW_REG_ registers */
706 zd_addr_t fw_regs_base; 706 zd_addr_t fw_regs_base;
707 u8 e2p_mac[ETH_ALEN];
708 /* EepSetPoint in the vendor driver */ 707 /* EepSetPoint in the vendor driver */
709 u8 pwr_cal_values[E2P_CHANNEL_COUNT]; 708 u8 pwr_cal_values[E2P_CHANNEL_COUNT];
710 /* integration values in the vendor driver */ 709 /* integration values in the vendor driver */
@@ -715,7 +714,7 @@ struct zd_chip {
715 unsigned int pa_type:4, 714 unsigned int pa_type:4,
716 patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1, 715 patch_cck_gain:1, patch_cr157:1, patch_6m_band_edge:1,
717 new_phy_layout:1, al2230s_bit:1, 716 new_phy_layout:1, al2230s_bit:1,
718 is_zd1211b:1, supports_tx_led:1; 717 supports_tx_led:1;
719}; 718};
720 719
721static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb) 720static inline struct zd_chip *zd_usb_to_chip(struct zd_usb *usb)
@@ -734,9 +733,15 @@ void zd_chip_init(struct zd_chip *chip,
734 struct net_device *netdev, 733 struct net_device *netdev,
735 struct usb_interface *intf); 734 struct usb_interface *intf);
736void zd_chip_clear(struct zd_chip *chip); 735void zd_chip_clear(struct zd_chip *chip);
737int zd_chip_init_hw(struct zd_chip *chip, u8 device_type); 736int zd_chip_read_mac_addr_fw(struct zd_chip *chip, u8 *addr);
737int zd_chip_init_hw(struct zd_chip *chip);
738int zd_chip_reset(struct zd_chip *chip); 738int zd_chip_reset(struct zd_chip *chip);
739 739
740static inline int zd_chip_is_zd1211b(struct zd_chip *chip)
741{
742 return chip->usb.is_zd1211b;
743}
744
740static inline int zd_ioread16v_locked(struct zd_chip *chip, u16 *values, 745static inline int zd_ioread16v_locked(struct zd_chip *chip, u16 *values,
741 const zd_addr_t *addresses, 746 const zd_addr_t *addresses,
742 unsigned int count) 747 unsigned int count)
@@ -825,8 +830,6 @@ static inline u8 _zd_chip_get_channel(struct zd_chip *chip)
825} 830}
826u8 zd_chip_get_channel(struct zd_chip *chip); 831u8 zd_chip_get_channel(struct zd_chip *chip);
827int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain); 832int zd_read_regdomain(struct zd_chip *chip, u8 *regdomain);
828void zd_get_e2p_mac_addr(struct zd_chip *chip, u8 *mac_addr);
829int zd_read_mac_addr(struct zd_chip *chip, u8 *mac_addr);
830int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr); 833int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr);
831int zd_chip_switch_radio_on(struct zd_chip *chip); 834int zd_chip_switch_radio_on(struct zd_chip *chip);
832int zd_chip_switch_radio_off(struct zd_chip *chip); 835int zd_chip_switch_radio_off(struct zd_chip *chip);