commit 8c248b86f0904bf82b58874a4fa716845ebfe9d0 Author: Jiri Slaby Date: Mon Jun 18 17:26:24 2007 +0200 basic join of the two parts diff --git a/Makefile b/Makefile index ab632e8..e891fe0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,20 @@ KDIR=/lib/modules/$(shell uname -r)/build KBUILD=$(MAKE) -C $(KDIR) M=$(PWD) -obj-y += openhal/ ath/ +ifeq ($(strip $(BUS)),AHB) +EXTRA_CFLAGS += -DATH_AHB +bus=ath +else +EXTRA_CFLAGS += -DATH_PCI +bus=pci +endif + +EXTRA_CFLAGS += -I$(src)/openhal + +ath5k-objs := ath/if_ath.o ath/if_ath_$(bus).o openhal/ath5k_hw.o \ + openhal/ieee80211_regdomain.o #ath/radar.o + +obj-m += ath5k.o all: $(KBUILD) modules diff --git a/ath/Kbuild b/ath/Kbuild deleted file mode 100644 index 808a66b..0000000 --- a/ath/Kbuild +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2007 Jiri Slaby -# All rights reserved. -# -# This software may be distributed under the terms of the -# GNU General Public License ("GPL") version 2 as published by the Free -# Software Foundation. - -ifeq ($(strip $(BUS)),AHB) -EXTRA_CFLAGS += -DATH_AHB -bus=ath -else -EXTRA_CFLAGS += -DATH_PCI -bus=pci -endif - -obj-m += ath_$(bus).o -ath_ahb-objs := if_ath.o if_ath_ahb.o #radar.o -ath_pci-objs := if_ath.o if_ath_pci.o #radar.o - -EXTRA_CFLAGS += -I$(src)/../openhal diff --git a/ath/if_ath.c b/ath/if_ath.c index f2a6748..53bfe5b 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -360,7 +360,7 @@ ath_attach(u_int16_t devid, struct net_device *dev) /* * Attach the hal */ - ah = ath_hal_attach(devid, sc, sc->sc_iobase, &status); + ah = ath5k_hw_init(devid, sc, sc->sc_iobase, &status); if (ah == NULL) { printk(KERN_ERR "%s: unable to attach hardware: '%s' (HAL status %u)\n", __func__, hal_status_desc[status], status); @@ -740,7 +740,7 @@ bad2: ath_desc_free(sc); bad: if (ah) { - ath_hal_detach(ah); + ah->ah_detach(ah); } sc->sc_invalid = 1; return error; @@ -771,7 +771,7 @@ ath_detach(struct net_device *dev) // ath_rate_detach(sc->sc_rc); ath_desc_free(sc); ath_tx_cleanup(sc); - ath_hal_detach(sc->sc_ah); + sc->sc_ah->ah_detach(sc->sc_ah); /* * NB: can't reclaim these until after ieee80211_ifdetach diff --git a/openhal/Kbuild b/openhal/Kbuild deleted file mode 100644 index 9007072..0000000 --- a/openhal/Kbuild +++ /dev/null @@ -1,2 +0,0 @@ -obj-m += ath_hal.o -ath_hal-objs := ah_osdep.o ath5k_hw.o ieee80211_regdomain.o diff --git a/openhal/ah_osdep.c b/openhal/ah_osdep.c deleted file mode 100644 index f76c0a2..0000000 --- a/openhal/ah_osdep.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2006-2007 Nick Kossifidis - * Copyright (c) 2007 Jiri Slaby - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - */ - -#include "ath5k.h" - -static char dev_info[] = "ath_hal"; - -struct ath_hal *ath_hal_attach(u16 devid, void *sc, void __iomem *h, - enum ath5k_status *s) -{ - struct ath_hal *ah = ath5k_hw_init(devid, sc, h, s); - - if (ah && !try_module_get(THIS_MODULE)) { - printk(KERN_WARNING "try_module_get failed\n"); - kfree(ah); - return NULL; - } - - return ah; -} -EXPORT_SYMBOL(ath_hal_attach); - -void ath_hal_detach(struct ath_hal *ah) -{ - ah->ah_detach(ah); - module_put(THIS_MODULE); -} -EXPORT_SYMBOL(ath_hal_detach); - -static int __init ath_hal_init(void) -{ - printk(KERN_INFO "%s: OpenHAL loaded (AR5210, AR5211, AR5212, " - "RF5110/1/2)\n", dev_info); - return 0; -} - -static void __exit ath_hal_exit(void) -{ - printk(KERN_INFO "%s: driver unloaded\n", dev_info); -} - -module_init(ath_hal_init); -module_exit(ath_hal_exit); - -MODULE_AUTHOR("Nick Kossifidis"); -MODULE_DESCRIPTION("OpenHAL"); -MODULE_SUPPORTED_DEVICE("Atheros AR5xxx WLAN cards"); -MODULE_LICENSE("Dual BSD/GPL"); diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 830612b..4fc5efa 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -1247,7 +1247,4 @@ void ath5k_txpower_table(struct ath_hal *, struct ath5k_channel *, s16); /*added*/ extern u_int ath_hal_getwirelessmodes(struct ath_hal *, enum ieee80211_countrycode); -void ath_hal_detach(struct ath_hal *ah); -struct ath_hal *ath_hal_attach(u16 devid, void *sc, void __iomem *h, - enum ath5k_status *s); #endif /* _AR5K_H */ diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index df0b1ec..ea4d086 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -160,7 +160,6 @@ ath_hal_probe(u16 vendor, u16 device) return NULL; } -EXPORT_SYMBOL(ath_hal_probe); /* * Calculate transmition time of a frame @@ -227,7 +226,6 @@ ath_hal_computetxtime(struct ath_hal *hal, const struct ath5k_rate_table *rates, return value; } -EXPORT_SYMBOL(ath_hal_computetxtime); /* * Return the supported 802.11 operation modes @@ -245,7 +243,6 @@ ath_hal_getwirelessmodes(struct ath_hal *hal, enum ieee80211_countrycode country return(AR5K_MODE_11A); } } -EXPORT_SYMBOL(ath_hal_getwirelessmodes); /* * Functions used internaly @@ -4725,7 +4722,6 @@ ath_hal_mhz2ieee(unsigned int freq, u_int flags) /* something is fishy, don't do anything */ return 0; } -EXPORT_SYMBOL(ath_hal_mhz2ieee); /* * Convert IEEE channel number to MHz frequency. @@ -4752,7 +4748,6 @@ ath_hal_ieee2mhz(unsigned int chan, u_int flags) return 5000 + (chan * 5); } } -EXPORT_SYMBOL(ath_hal_ieee2mhz); /* * Check if a channel is supported @@ -4913,7 +4908,6 @@ for loop starts from 1 and all channels are marked as 5GHz M.F.*/ kfree(all_channels); return true; } -EXPORT_SYMBOL(ath_hal_init_channels); /* * Regdomain stuff, these also don't belong here etc