|
@@ -161,12 +161,6 @@ typedef struct wlan_80211hdr
|
161
|
161
|
* Function prototypes
|
162
|
162
|
*/
|
163
|
163
|
|
164
|
|
-#if (WLAN_HOSTIF == WLAN_PLX)
|
165
|
|
-static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p );
|
166
|
|
-#elif (WLAN_HOSTIF == WLAN_PCI)
|
167
|
|
-static int prism2_find_pci ( hfa384x_t *hw, struct pci_device *p );
|
168
|
|
-#endif
|
169
|
|
-
|
170
|
164
|
|
171
|
165
|
* Hardware-level hfa384x functions
|
172
|
166
|
* These are based on the ones in hfa384x.h (which are ifdef'd out since __KERNEL__ is not defined).
|
|
@@ -746,18 +740,22 @@ static void prism2_irq(struct nic *nic __unused, irq_action_t action __unused)
|
746
|
740
|
}
|
747
|
741
|
}
|
748
|
742
|
|
|
743
|
+
|
|
744
|
+Operations table
|
|
745
|
+***************************************************************************/
|
|
746
|
+static struct nic_operations prism2_operations = {
|
|
747
|
+ .connect = dummy_connect,
|
|
748
|
+ .poll = prism2_poll,
|
|
749
|
+ .transmit = prism2_transmit,
|
|
750
|
+ .irq = prism2_irq,
|
|
751
|
+ .disable = prism2_disable,
|
|
752
|
+};
|
|
753
|
+
|
749
|
754
|
|
750
|
755
|
PROBE - Look for an adapter, this routine's visible to the outside
|
751
|
756
|
You should omit the last argument struct pci_device * for a non-PCI NIC
|
752
|
757
|
***************************************************************************/
|
753
|
|
-#if (WLAN_HOSTIF == WLAN_PLX)
|
754
|
|
-static int prism2_plx_probe(struct dev *dev, struct pci_device *p)
|
755
|
|
-#elif (WLAN_HOSTIF == WLAN_PCI)
|
756
|
|
-static int prism2_pci_probe(struct dev *dev, struct pci_device *p)
|
757
|
|
-#endif
|
758
|
|
-{
|
759
|
|
- struct nic *nic = (struct nic *)dev;
|
760
|
|
- hfa384x_t *hw = &hw_global;
|
|
758
|
+static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
|
761
|
759
|
int result;
|
762
|
760
|
UINT16 tmp16 = 0;
|
763
|
761
|
UINT16 infofid;
|
|
@@ -765,15 +763,6 @@ static int prism2_pci_probe(struct dev *dev, struct pci_device *p)
|
765
|
763
|
char ssid[HFA384x_RID_CNFDESIREDSSID_LEN];
|
766
|
764
|
int info_count = 0;
|
767
|
765
|
|
768
|
|
-
|
769
|
|
-#if (WLAN_HOSTIF == WLAN_PLX)
|
770
|
|
- if ( ! prism2_find_plx ( hw, p ) ) return 0;
|
771
|
|
- nic->ioaddr = hw->iobase;
|
772
|
|
-#elif (WLAN_HOSTIF == WLAN_PCI)
|
773
|
|
- if ( ! prism2_find_pci ( hw, p ) ) return 0;
|
774
|
|
- nic->ioaddr = hw->membase;
|
775
|
|
-#endif
|
776
|
|
-
|
777
|
766
|
nic->irqno = 0;
|
778
|
767
|
|
779
|
768
|
|
|
@@ -856,96 +845,7 @@ static int prism2_pci_probe(struct dev *dev, struct pci_device *p)
|
856
|
845
|
printf ( "Link connected (BSSID %! - MAC address %!)\n", hw->bssid, nic->node_addr );
|
857
|
846
|
|
858
|
847
|
|
859
|
|
-static struct nic_operations prism2_operations;
|
860
|
|
-static struct nic_operations prism2_operations = {
|
861
|
|
- .connect = dummy_connect,
|
862
|
|
- .poll = prism2_poll,
|
863
|
|
- .transmit = prism2_transmit,
|
864
|
|
- .irq = prism2_irq,
|
865
|
|
- .disable = prism2_disable,
|
866
|
|
-}; nic->nic_op = &prism2_operations;
|
867
|
|
- return 1;
|
868
|
|
-}
|
869
|
|
-
|
870
|
|
-#if (WLAN_HOSTIF == WLAN_PLX)
|
871
|
|
-
|
872
|
|
- * Find PLX card. Prints out information strings from PCMCIA CIS as visual
|
873
|
|
- * confirmation of presence of card.
|
874
|
|
- *
|
875
|
|
- * Arguments:
|
876
|
|
- * hw device structure to be filled in
|
877
|
|
- * p PCI device structure
|
878
|
|
- *
|
879
|
|
- * Returns:
|
880
|
|
- * 1 Success
|
881
|
|
- */
|
882
|
|
-static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
|
883
|
|
-{
|
884
|
|
- int found = 0;
|
885
|
|
- uint32_t plx_lcr = 0;
|
886
|
|
- uint32_t attr_mem = 0;
|
887
|
|
- uint32_t iobase = 0;
|
888
|
|
- unsigned char *cis_tpl = NULL;
|
889
|
|
- unsigned char *cis_string;
|
890
|
|
-
|
891
|
|
-
|
892
|
|
- pcibios_read_config_dword( p->bus, p->devfn, PLX_LOCAL_CONFIG_REGISTER_BASE, &plx_lcr);
|
893
|
|
- plx_lcr &= PCI_BASE_ADDRESS_IO_MASK;
|
894
|
|
- pcibios_read_config_dword( p->bus, p->devfn, PRISM2_PLX_ATTR_MEM_BASE, &attr_mem);
|
895
|
|
- pcibios_read_config_dword( p->bus, p->devfn, PRISM2_PLX_IO_BASE, &iobase);
|
896
|
|
- iobase &= PCI_BASE_ADDRESS_IO_MASK;
|
897
|
|
-
|
898
|
|
-
|
899
|
|
- hw->membase = attr_mem;
|
900
|
|
- hw->iobase = iobase;
|
901
|
|
- printf ( "PLX9052 has local config registers at %#hx\n", plx_lcr );
|
902
|
|
- printf ( "Prism2 has attribute memory at %#x and I/O base at %#hx\n", attr_mem, iobase );
|
903
|
|
-
|
904
|
|
-
|
905
|
|
- printf ( "Searching for PCMCIA card...\n" );
|
906
|
|
- cis_tpl = bus_to_virt(attr_mem);
|
907
|
|
- while ( *cis_tpl != CISTPL_END ) {
|
908
|
|
- if ( *cis_tpl == CISTPL_VERS_1 ) {
|
909
|
|
-
|
910
|
|
- printf ( "...found " );
|
911
|
|
- found = 1;
|
912
|
|
- cis_string = cis_tpl + CISTPL_VERS_1_STR_OFF;
|
913
|
|
- while ( ! ( ( *cis_string == 0 ) && ( *(cis_string+CIS_STEP) == 0 ) ) ) {
|
914
|
|
- printf ( "%c", *cis_string == 0 ? ' ' : *cis_string );
|
915
|
|
- cis_string += CIS_STEP;
|
916
|
|
- }
|
917
|
|
- printf ( "\n" );
|
918
|
|
- }
|
919
|
|
-
|
920
|
|
- cis_tpl += CISTPL_HEADER_LEN + CIS_STEP * ( *(cis_tpl+CISTPL_LEN_OFF) );
|
921
|
|
- }
|
922
|
|
- if ( found == 0 ) {
|
923
|
|
- printf ( "...nothing found\n" );
|
924
|
|
- }
|
925
|
|
- ((unsigned char *)bus_to_virt(attr_mem))[COR_OFFSET] = COR_VALUE;
|
926
|
|
- return found;
|
927
|
|
-}
|
928
|
|
-#endif
|
929
|
|
-
|
930
|
|
-#if (WLAN_HOSTIF == WLAN_PCI)
|
931
|
|
-
|
932
|
|
- * Find PCI card.
|
933
|
|
- *
|
934
|
|
- * Arguments:
|
935
|
|
- * hw device structure to be filled in
|
936
|
|
- * p PCI device structure
|
937
|
|
- *
|
938
|
|
- * Returns:
|
939
|
|
- * 1 Success
|
940
|
|
- */
|
941
|
|
-static int prism2_find_pci ( hfa384x_t *hw, struct pci_device *p )
|
942
|
|
-{
|
943
|
|
- uint32_t membase = 0;
|
944
|
|
- pcibios_read_config_dword( p->bus, p->devfn, PRISM2_PCI_MEM_BASE, &membase);
|
945
|
|
- membase &= PCI_BASE_ADDRESS_MEM_MASK;
|
946
|
|
- hw->membase = (uint32_t) phys_to_virt(membase);
|
947
|
|
- printf ( "Prism2.5 has registers at %#x\n", hw->membase );
|
|
848
|
+ nic->nic_op = &prism2_operations;
|
948
|
849
|
return 1;
|
949
|
850
|
}
|
950
|
|
-#endif
|
951
|
851
|
|