Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7713ccc authored by David S. Miller's avatar David S. Miller
Browse files
parents 11c6dd2c 020cf6ba
Loading
Loading
Loading
Loading
+34 −1
Original line number Original line Diff line number Diff line
@@ -240,6 +240,10 @@ static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
static void ath5k_reset_tsf(struct ieee80211_hw *hw);
static void ath5k_reset_tsf(struct ieee80211_hw *hw);
static int ath5k_beacon_update(struct ieee80211_hw *hw,
static int ath5k_beacon_update(struct ieee80211_hw *hw,
		struct sk_buff *skb);
		struct sk_buff *skb);
static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
		struct ieee80211_vif *vif,
		struct ieee80211_bss_conf *bss_conf,
		u32 changes);


static struct ieee80211_ops ath5k_hw_ops = {
static struct ieee80211_ops ath5k_hw_ops = {
	.tx 		= ath5k_tx,
	.tx 		= ath5k_tx,
@@ -256,6 +260,7 @@ static struct ieee80211_ops ath5k_hw_ops = {
	.get_tx_stats 	= ath5k_get_tx_stats,
	.get_tx_stats 	= ath5k_get_tx_stats,
	.get_tsf 	= ath5k_get_tsf,
	.get_tsf 	= ath5k_get_tsf,
	.reset_tsf 	= ath5k_reset_tsf,
	.reset_tsf 	= ath5k_reset_tsf,
	.bss_info_changed = ath5k_bss_info_changed,
};
};


/*
/*
@@ -2942,7 +2947,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
		sc->opmode != NL80211_IFTYPE_MESH_POINT &&
		sc->opmode != NL80211_IFTYPE_MESH_POINT &&
		test_bit(ATH_STAT_PROMISC, sc->status))
		test_bit(ATH_STAT_PROMISC, sc->status))
		rfilt |= AR5K_RX_FILTER_PROM;
		rfilt |= AR5K_RX_FILTER_PROM;
	if (sc->opmode == NL80211_IFTYPE_STATION ||
	if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) ||
		sc->opmode == NL80211_IFTYPE_ADHOC) {
		sc->opmode == NL80211_IFTYPE_ADHOC) {
		rfilt |= AR5K_RX_FILTER_BEACON;
		rfilt |= AR5K_RX_FILTER_BEACON;
	}
	}
@@ -3083,4 +3088,32 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
end:
end:
	return ret;
	return ret;
}
}
static void
set_beacon_filter(struct ieee80211_hw *hw, bool enable)
{
	struct ath5k_softc *sc = hw->priv;
	struct ath5k_hw *ah = sc->ah;
	u32 rfilt;
	rfilt = ath5k_hw_get_rx_filter(ah);
	if (enable)
		rfilt |= AR5K_RX_FILTER_BEACON;
	else
		rfilt &= ~AR5K_RX_FILTER_BEACON;
	ath5k_hw_set_rx_filter(ah, rfilt);
	sc->filter_flags = rfilt;
}


static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
				    struct ieee80211_vif *vif,
				    struct ieee80211_bss_conf *bss_conf,
				    u32 changes)
{
	struct ath5k_softc *sc = hw->priv;
	if (changes & BSS_CHANGED_ASSOC) {
		mutex_lock(&sc->lock);
		sc->assoc = bss_conf->assoc;
		if (sc->opmode == NL80211_IFTYPE_STATION)
			set_beacon_filter(hw, sc->assoc);
		mutex_unlock(&sc->lock);
	}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -179,6 +179,7 @@ struct ath5k_softc {


	struct timer_list	calib_tim;	/* calibration timer */
	struct timer_list	calib_tim;	/* calibration timer */
	int 			power_level;	/* Requested tx power in dbm */
	int 			power_level;	/* Requested tx power in dbm */
	bool			assoc;		/* assocate state */
};
};


#define ath5k_hw_hasbssidmask(_ah) \
#define ath5k_hw_hasbssidmask(_ah) \
+5 −5
Original line number Original line Diff line number Diff line
@@ -417,19 +417,19 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
	sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
	sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
				ath5k_global_debugfs);
				ath5k_global_debugfs);


	sc->debug.debugfs_debug = debugfs_create_file("debug", 0666,
	sc->debug.debugfs_debug = debugfs_create_file("debug", S_IWUSR | S_IRUGO,
				sc->debug.debugfs_phydir, sc, &fops_debug);
				sc->debug.debugfs_phydir, sc, &fops_debug);


	sc->debug.debugfs_registers = debugfs_create_file("registers", 0444,
	sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO,
				sc->debug.debugfs_phydir, sc, &fops_registers);
				sc->debug.debugfs_phydir, sc, &fops_registers);


	sc->debug.debugfs_tsf = debugfs_create_file("tsf", 0666,
	sc->debug.debugfs_tsf = debugfs_create_file("tsf", S_IWUSR | S_IRUGO,
				sc->debug.debugfs_phydir, sc, &fops_tsf);
				sc->debug.debugfs_phydir, sc, &fops_tsf);


	sc->debug.debugfs_beacon = debugfs_create_file("beacon", 0666,
	sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO,
				sc->debug.debugfs_phydir, sc, &fops_beacon);
				sc->debug.debugfs_phydir, sc, &fops_beacon);


	sc->debug.debugfs_reset = debugfs_create_file("reset", 0222,
	sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR,
				sc->debug.debugfs_phydir, sc, &fops_reset);
				sc->debug.debugfs_phydir, sc, &fops_reset);
}
}


+5 −5
Original line number Original line Diff line number Diff line
@@ -170,7 +170,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
	skb = (struct sk_buff *)bf->bf_mpdu;
	skb = (struct sk_buff *)bf->bf_mpdu;
	if (skb) {
	if (skb) {
		pci_unmap_single(sc->pdev, bf->bf_dmacontext,
		pci_unmap_single(sc->pdev, bf->bf_dmacontext,
				 skb_end_pointer(skb) - skb->head,
				 skb->len,
				 PCI_DMA_TODEVICE);
				 PCI_DMA_TODEVICE);
	}
	}


@@ -193,7 +193,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)


	bf->bf_buf_addr = bf->bf_dmacontext =
	bf->bf_buf_addr = bf->bf_dmacontext =
		pci_map_single(sc->pdev, skb->data,
		pci_map_single(sc->pdev, skb->data,
			       skb_end_pointer(skb) - skb->head,
			       skb->len,
			       PCI_DMA_TODEVICE);
			       PCI_DMA_TODEVICE);


	skb = ieee80211_get_buffered_bc(sc->hw, avp->av_if_data);
	skb = ieee80211_get_buffered_bc(sc->hw, avp->av_if_data);
@@ -352,7 +352,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
	if (bf->bf_mpdu != NULL) {
	if (bf->bf_mpdu != NULL) {
		skb = (struct sk_buff *)bf->bf_mpdu;
		skb = (struct sk_buff *)bf->bf_mpdu;
		pci_unmap_single(sc->pdev, bf->bf_dmacontext,
		pci_unmap_single(sc->pdev, bf->bf_dmacontext,
				 skb_end_pointer(skb) - skb->head,
				 skb->len,
				 PCI_DMA_TODEVICE);
				 PCI_DMA_TODEVICE);
		dev_kfree_skb_any(skb);
		dev_kfree_skb_any(skb);
		bf->bf_mpdu = NULL;
		bf->bf_mpdu = NULL;
@@ -412,7 +412,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)


	bf->bf_buf_addr = bf->bf_dmacontext =
	bf->bf_buf_addr = bf->bf_dmacontext =
		pci_map_single(sc->pdev, skb->data,
		pci_map_single(sc->pdev, skb->data,
			       skb_end_pointer(skb) - skb->head,
			       skb->len,
			       PCI_DMA_TODEVICE);
			       PCI_DMA_TODEVICE);
	bf->bf_mpdu = skb;
	bf->bf_mpdu = skb;


@@ -439,7 +439,7 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp)
		if (bf->bf_mpdu != NULL) {
		if (bf->bf_mpdu != NULL) {
			struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu;
			struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu;
			pci_unmap_single(sc->pdev, bf->bf_dmacontext,
			pci_unmap_single(sc->pdev, bf->bf_dmacontext,
					 skb_end_pointer(skb) - skb->head,
					 skb->len,
					 PCI_DMA_TODEVICE);
					 PCI_DMA_TODEVICE);
			dev_kfree_skb_any(skb);
			dev_kfree_skb_any(skb);
			bf->bf_mpdu = NULL;
			bf->bf_mpdu = NULL;
+14 −5
Original line number Original line Diff line number Diff line
@@ -49,10 +49,12 @@ static void ath_rx_buf_link(struct ath_softc *sc, struct ath_buf *bf)
	ASSERT(skb != NULL);
	ASSERT(skb != NULL);
	ds->ds_vdata = skb->data;
	ds->ds_vdata = skb->data;


	/* setup rx descriptors */
	/* setup rx descriptors. The sc_rxbufsize here tells the harware
	 * how much data it can DMA to us and that we are prepared
	 * to process */
	ath9k_hw_setuprxdesc(ah,
	ath9k_hw_setuprxdesc(ah,
			     ds,
			     ds,
			     skb_tailroom(skb),   /* buffer size */
			     sc->sc_rxbufsize,
			     0);
			     0);


	if (sc->sc_rxlink == NULL)
	if (sc->sc_rxlink == NULL)
@@ -398,6 +400,13 @@ static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc,
	 * in rx'd frames.
	 * in rx'd frames.
	 */
	 */


	/* Note: the kernel can allocate a value greater than
	 * what we ask it to give us. We really only need 4 KB as that
	 * is this hardware supports and in fact we need at least 3849
	 * as that is the MAX AMSDU size this hardware supports.
	 * Unfortunately this means we may get 8 KB here from the
	 * kernel... and that is actually what is observed on some
	 * systems :( */
	skb = dev_alloc_skb(len + sc->sc_cachelsz - 1);
	skb = dev_alloc_skb(len + sc->sc_cachelsz - 1);
	if (skb != NULL) {
	if (skb != NULL) {
		off = ((unsigned long) skb->data) % sc->sc_cachelsz;
		off = ((unsigned long) skb->data) % sc->sc_cachelsz;
@@ -456,7 +465,7 @@ static int ath_rx_indicate(struct ath_softc *sc,
	if (nskb != NULL) {
	if (nskb != NULL) {
		bf->bf_mpdu = nskb;
		bf->bf_mpdu = nskb;
		bf->bf_buf_addr = pci_map_single(sc->pdev, nskb->data,
		bf->bf_buf_addr = pci_map_single(sc->pdev, nskb->data,
					 skb_end_pointer(nskb) - nskb->head,
					 sc->sc_rxbufsize,
					 PCI_DMA_FROMDEVICE);
					 PCI_DMA_FROMDEVICE);
		bf->bf_dmacontext = bf->bf_buf_addr;
		bf->bf_dmacontext = bf->bf_buf_addr;
		ATH_RX_CONTEXT(nskb)->ctx_rxbuf = bf;
		ATH_RX_CONTEXT(nskb)->ctx_rxbuf = bf;
@@ -542,7 +551,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)


			bf->bf_mpdu = skb;
			bf->bf_mpdu = skb;
			bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data,
			bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data,
					 skb_end_pointer(skb) - skb->head,
					 sc->sc_rxbufsize,
					 PCI_DMA_FROMDEVICE);
					 PCI_DMA_FROMDEVICE);
			bf->bf_dmacontext = bf->bf_buf_addr;
			bf->bf_dmacontext = bf->bf_buf_addr;
			ATH_RX_CONTEXT(skb)->ctx_rxbuf = bf;
			ATH_RX_CONTEXT(skb)->ctx_rxbuf = bf;
@@ -1007,7 +1016,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)


		pci_dma_sync_single_for_cpu(sc->pdev,
		pci_dma_sync_single_for_cpu(sc->pdev,
					    bf->bf_buf_addr,
					    bf->bf_buf_addr,
					    skb_tailroom(skb),
					    sc->sc_rxbufsize,
					    PCI_DMA_FROMDEVICE);
					    PCI_DMA_FROMDEVICE);
		pci_unmap_single(sc->pdev,
		pci_unmap_single(sc->pdev,
				 bf->bf_buf_addr,
				 bf->bf_buf_addr,
Loading