aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/b43.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-01-23 15:21:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:30 -0500
commit1a9f509368ceb24fc66be961be15c69966f5eb5d (patch)
treec038db8330a52ad757ef630cbe8738e1f5afc1ca /drivers/net/wireless/b43/b43.h
parent2f47690ed42a85820783dee7f16ae47edadf8fad (diff)
b43: Automatically probe for opensource firmware
First probe for proprietary firmware and then probe for opensource firmware. This way around it's a win-win situation. 1) If proprietary fw is available, it will work. 2) If opensource firmware is available, but no proprietary (Distros can only ship open fw) it might work. 3) If both open and proprietary are available, it will work, because it selects the proprietary. We currently don't prefer the open fw in this case, because it doesn't work on all devices. It would introduce a regression otherwise. The remaining FIXMEs in this patch are harmless, because they only matter on multiband devices, which are not implemented yet anyway. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/b43.h')
-rw-r--r--drivers/net/wireless/b43/b43.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index a53c378e7484..9e0da212f8ce 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -655,10 +655,39 @@ struct b43_wl {
655 struct work_struct txpower_adjust_work; 655 struct work_struct txpower_adjust_work;
656}; 656};
657 657
658/* The type of the firmware file. */
659enum b43_firmware_file_type {
660 B43_FWTYPE_PROPRIETARY,
661 B43_FWTYPE_OPENSOURCE,
662 B43_NR_FWTYPES,
663};
664
665/* Context data for fetching firmware. */
666struct b43_request_fw_context {
667 /* The device we are requesting the fw for. */
668 struct b43_wldev *dev;
669 /* The type of firmware to request. */
670 enum b43_firmware_file_type req_type;
671 /* Error messages for each firmware type. */
672 char errors[B43_NR_FWTYPES][128];
673 /* Temporary buffer for storing the firmware name. */
674 char fwname[64];
675 /* A fatal error occured while requesting. Firmware reqest
676 * can not continue, as any other reqest will also fail. */
677 int fatal_failure;
678};
679
658/* In-memory representation of a cached microcode file. */ 680/* In-memory representation of a cached microcode file. */
659struct b43_firmware_file { 681struct b43_firmware_file {
660 const char *filename; 682 const char *filename;
661 const struct firmware *data; 683 const struct firmware *data;
684 /* Type of the firmware file name. Note that this does only indicate
685 * the type by the firmware name. NOT the file contents.
686 * If you want to check for proprietary vs opensource, use (struct b43_firmware)->opensource
687 * instead! The (struct b43_firmware)->opensource flag is derived from the actual firmware
688 * binary code, not just the filename.
689 */
690 enum b43_firmware_file_type type;
662}; 691};
663 692
664/* Pointers to the firmware data and meta information about it. */ 693/* Pointers to the firmware data and meta information about it. */
@@ -677,7 +706,8 @@ struct b43_firmware {
677 /* Firmware patchlevel */ 706 /* Firmware patchlevel */
678 u16 patch; 707 u16 patch;
679 708
680 /* Set to true, if we are using an opensource firmware. */ 709 /* Set to true, if we are using an opensource firmware.
710 * Use this to check for proprietary vs opensource. */
681 bool opensource; 711 bool opensource;
682 /* Set to true, if the core needs a PCM firmware, but 712 /* Set to true, if the core needs a PCM firmware, but
683 * we failed to load one. This is always false for 713 * we failed to load one. This is always false for