LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 07-24-2009, 01:22 PM   #1
gregnorc
LQ Newbie
 
Registered: Jul 2009
Posts: 29

Rep: Reputation: 15
patching ath5k to enable master mode


Ok so my research has led me to conclude that my eee (which has an Athero AR5BXB63 wireless chip) can only put ath5k into master mode if I patch ath5k.

I downloaded compat wireless, and the patch (found here: http://wifi.ozo.com/airo/openwrt/fir...80211-patches/)

The patch mentions a specific git snapshot, but the link is broken to it. I think this might be the issue.

Anyways when I go into the compat wireless directory for ath5k and attempt to patch, this is the output from the command:
Code:
[songwhale@localhost ath5k]$ sudo patch ./base.c 007-ath5k-ap-mode.patch 
patching file ./base.c
Hunk #1 FAILED at 190.
Hunk #2 FAILED at 2122.
Hunk #3 FAILED at 2134.
Hunk #4 FAILED at 2147.
Hunk #5 FAILED at 2707.
Hunk #6 FAILED at 2771.
Hunk #7 FAILED at 2779.
Hunk #8 FAILED at 3019.
Hunk #9 FAILED at 3038.
9 out of 9 hunks FAILED -- saving rejects to file ./base.c.rej

This is the contents of the base.c.rejects file:
Code:
***************
*** 190,197 ****
  		struct ieee80211_tx_queue_stats *stats);
  static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
  static void ath5k_reset_tsf(struct ieee80211_hw *hw);
- static int ath5k_beacon_update(struct ieee80211_hw *hw,
- 		struct sk_buff *skb);
  
  static struct ieee80211_ops ath5k_hw_ops = {
  	.tx 		= ath5k_tx,
--- 190,196 ----
  		struct ieee80211_tx_queue_stats *stats);
  static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
  static void ath5k_reset_tsf(struct ieee80211_hw *hw);
+ static int ath5k_beacon_update(struct ath5k_softc *sc, struct sk_buff *skb);
  
  static struct ieee80211_ops ath5k_hw_ops = {
  	.tx 		= ath5k_tx,
***************
*** 2123,2130 ****
   *
   * In IBSS mode we use a self-linked tx descriptor if possible. We enable SWBA
   * interrupts to detect TSF updates only.
-  *
-  * AP mode is missing.
   */
  static void
  ath5k_beacon_config(struct ath5k_softc *sc)
--- 2122,2127 ----
   *
   * In IBSS mode we use a self-linked tx descriptor if possible. We enable SWBA
   * interrupts to detect TSF updates only.
   */
  static void
  ath5k_beacon_config(struct ath5k_softc *sc)
***************
*** 2137,2143 ****
  
  	if (sc->opmode == IEEE80211_IF_TYPE_STA) {
  		sc->imask |= AR5K_INT_BMISS;
- 	} else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) {
  		/*
  		 * In IBSS mode we use a self-linked tx descriptor and let the
  		 * hardware send the beacons automatically. We have to load it
--- 2134,2141 ----
  
  	if (sc->opmode == IEEE80211_IF_TYPE_STA) {
  		sc->imask |= AR5K_INT_BMISS;
+ 	} else if (sc->opmode == IEEE80211_IF_TYPE_IBSS ||
+ 			sc->opmode == IEEE80211_IF_TYPE_AP) {
  		/*
  		 * In IBSS mode we use a self-linked tx descriptor and let the
  		 * hardware send the beacons automatically. We have to load it
***************
*** 2149,2161 ****
  
  		sc->imask |= AR5K_INT_SWBA;
  
- 		if (ath5k_hw_hasveol(ah)) {
- 			spin_lock(&sc->block);
- 			ath5k_beacon_send(sc);
- 			spin_unlock(&sc->block);
- 		}
  	}
- 	/* TODO else AP */
  
  	ath5k_hw_set_intr(ah, sc->imask);
  }
--- 2147,2161 ----
  
  		sc->imask |= AR5K_INT_SWBA;
  
+ 		if (sc->opmode == IEEE80211_IF_TYPE_IBSS) {
+ 			if (ath5k_hw_hasveol(ah)) {
+ 				spin_lock(&sc->block);
+ 				ath5k_beacon_send(sc);
+ 				spin_unlock(&sc->block);
+ 			}
+ 		} else
+ 			ath5k_beacon_update_timers(sc, -1);
  	}
  
  	ath5k_hw_set_intr(ah, sc->imask);
  }
***************
*** 2707,2712 ****
  	sc->vif = conf->vif;
  
  	switch (conf->type) {
  	case IEEE80211_IF_TYPE_STA:
  	case IEEE80211_IF_TYPE_IBSS:
  	case IEEE80211_IF_TYPE_MNTR:
--- 2707,2713 ----
  	sc->vif = conf->vif;
  
  	switch (conf->type) {
+ 	case IEEE80211_IF_TYPE_AP:
  	case IEEE80211_IF_TYPE_STA:
  	case IEEE80211_IF_TYPE_IBSS:
  	case IEEE80211_IF_TYPE_MNTR:
***************
*** 2770,2776 ****
  		ret = -EIO;
  		goto unlock;
  	}
- 	if (conf->bssid) {
  		/* Cache for later use during resets */
  		memcpy(ah->ah_bssid, conf->bssid, ETH_ALEN);
  		/* XXX: assoc id is set to 0 for now, mac80211 doesn't have
--- 2771,2777 ----
  		ret = -EIO;
  		goto unlock;
  	}
+ 	if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) {
  		/* Cache for later use during resets */
  		memcpy(ah->ah_bssid, conf->bssid, ETH_ALEN);
  		/* XXX: assoc id is set to 0 for now, mac80211 doesn't have
***************
*** 2778,2795 ****
  		ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
  		mmiowb();
  	}
- 
  	if (conf->changed & IEEE80211_IFCC_BEACON &&
- 	    vif->type == IEEE80211_IF_TYPE_IBSS) {
  		struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
  		if (!beacon) {
  			ret = -ENOMEM;
  			goto unlock;
  		}
- 		/* call old handler for now */
- 		ath5k_beacon_update(hw, beacon);
  	}
- 
  	mutex_unlock(&sc->lock);
  
  	return ath5k_reset_wake(sc);
--- 2779,2794 ----
  		ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
  		mmiowb();
  	}
  	if (conf->changed & IEEE80211_IFCC_BEACON &&
+ 			(vif->type == IEEE80211_IF_TYPE_IBSS ||
+ 			 vif->type == IEEE80211_IF_TYPE_AP)) {
  		struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
  		if (!beacon) {
  			ret = -ENOMEM;
  			goto unlock;
  		}
+ 		ath5k_beacon_update(sc, beacon);
  	}
  	mutex_unlock(&sc->lock);
  
  	return ath5k_reset_wake(sc);
***************
*** 3020,3038 ****
  }
  
  static int
- ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
  {
- 	struct ath5k_softc *sc = hw->priv;
  	unsigned long flags;
  	int ret;
  
  	ath5k_debug_dump_skb(sc, skb, "BC  ", 1);
  
- 	if (sc->opmode != IEEE80211_IF_TYPE_IBSS) {
- 		ret = -EIO;
- 		goto end;
- 	}
- 
  	spin_lock_irqsave(&sc->block, flags);
  	ath5k_txbuf_free(sc, sc->bbuf);
  	sc->bbuf->skb = skb;
--- 3019,3031 ----
  }
  
  static int
+ ath5k_beacon_update(struct ath5k_softc *sc, struct sk_buff *skb)
  {
  	unsigned long flags;
  	int ret;
  
  	ath5k_debug_dump_skb(sc, skb, "BC  ", 1);
  
  	spin_lock_irqsave(&sc->block, flags);
  	ath5k_txbuf_free(sc, sc->bbuf);
  	sc->bbuf->skb = skb;
***************
*** 3045,3051 ****
  		mmiowb();
  	}
  
- end:
  	return ret;
  }
  
--- 3038,3043 ----
  		mmiowb();
  	}
  
  	return ret;
  }
Again, I think the issue might be that I wasn't able to grab the git snapshot the patch readme () mentioned, but I'm very new to using git and have no clue how to find a similar one. (Or it could be some other issue, I'm just completely stumped as to how to get this patch to work)
 
Old 07-25-2009, 08:22 AM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
Which kernel do you have?

I copied my /lib/modules/$(uname -r)/source/drivers/net/wireless directory to test if the patch would work for the http://wifi.ozo.com/airo/openwrt/fir...-ap-mode.patch.

I have a 2.6.27 version kernel.

I copied the patch to the wireless/ directory and cd'ed to the wireless/ath5k directory and then ran:
wget http://wifi.ozo.com/airo/openwrt/fir...-ap-mode.patch

Succesfully. Either your patch version and your kernel version don't match, or your patch command was wrong.
Code:
/wireless/ath5k> patch <../007-ath5k-ap-mode.patch
patching file base.c
Hunk #1 succeeded at 188 (offset -2 lines).
Hunk #2 succeeded at 2134 (offset 12 lines).
Hunk #3 succeeded at 2146 (offset 12 lines).
Hunk #4 succeeded at 2159 (offset 12 lines).
Hunk #5 succeeded at 2750 (offset 43 lines).
Hunk #6 succeeded at 2814 (offset 43 lines).
Hunk #7 succeeded at 2822 with fuzz 1 (offset 43 lines).
Hunk #8 succeeded at 3062 (offset 43 lines).
Hunk #9 succeeded at 3081 (offset 43 lines).

Last edited by jschiwal; 07-25-2009 at 01:34 PM. Reason: turned off annoying auto linking
 
Old 08-14-2009, 10:54 AM   #3
gregnorc
LQ Newbie
 
Registered: Jul 2009
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
Which kernel do you have?

I copied my /lib/modules/$(uname -r)/source/drivers/net/wireless directory to test if the patch would work for the http://wifi.ozo.com/airo/openwrt/fir...-ap-mode.patch.

I have a 2.6.27 version kernel.

I copied the patch to the wireless/ directory and cd'ed to the wireless/ath5k directory and then ran:
wget http://wifi.ozo.com/airo/openwrt/fir...-ap-mode.patch

Succesfully. Either your patch version and your kernel version don't match, or your patch command was wrong.
I guess maybe I'm doing something wrong or the patch isn't the right version. (Output from uname -a is
Code:
Linux localhost.localdomain 2.6.27.5-117.fc10.i686 #1 SMP Tue Nov 18
12:19:59 EST 2008 i686 i686 i386 GNU/Linux
I wasn't in the directory you mentioned... I was under the impression I needed to download compat wireless, patch the source code of the ath5k module, then compile (been using this tutorial: http://acx100.erley.org/stable.html)

Anyways when I run the patch command here's the output I get:
Code:
[songwhale@localhost ath5k]$ sudo patch
</usr/src/007-ath5k-ap-mode.patchpatching file base.c
Hunk #1 FAILED at 190.
Hunk #2 FAILED at 2122.
Hunk #3 FAILED at 2134.
Hunk #4 FAILED at 2147.
Hunk #5 FAILED at 2707.
Hunk #6 FAILED at 2771.
Hunk #7 FAILED at 2779.
Hunk #8 FAILED at 3019.
Hunk #9 FAILED at 3038.
9 out of 9 hunks FAILED -- saving rejects to file base.c.rej
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot use b/g channels in master mode. Swope Linux - Wireless Networking 0 04-25-2006 02:14 PM
Master mode on one NIC and Managed mode on the other ilan1 Linux - Networking 0 02-22-2006 08:02 PM
Patching Orinoco Gold to enable monitor mode ridertech Linux - Wireless Networking 1 05-04-2005 10:52 PM
Master Mode Cards Trano Linux - Wireless Networking 1 04-26-2005 03:56 PM
Patching Orinoco Drivers for Monitor Mode starnix Linux - Wireless Networking 0 08-20-2004 05:36 PM


All times are GMT -5. The time now is 07:48 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration