* [PATCH (2.6.24) 1/3] iwlwifi: fix add_interface
[not found] <20071126225416.467939000@sipsolutions.net>
@ 2007-11-26 22:54 ` Johannes Berg
2007-11-26 22:54 ` [PATCH (2.6.24) 2/3] mac80211: support devices/drivers that cannot change MAC address Johannes Berg
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2007-11-26 22:54 UTC (permalink / raw)
To: John Linville; +Cc: Zhu Yi, Reinette Chatre, linux-wireless
The iwlwifi drivers both make mac80211 accept an arbitrary number of
virtual interfaces while in reality they can only support one. Fix that.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
---
Please apply this to 2.6.24 as that has userspace interface (nl80211) to
add/remove virtual interfaces. There's *LOTS* to be done for proper
support, e.g. monitor mode is completely messed up, but this at least
doesn't let the user create multiple interfaces that won't work.
Please push to Jeff for .24.
drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 +-
drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-11-26 23:23:59.689045194 +0100
+++ linux-2.6/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-11-26 23:24:06.049043241 +0100
@@ -6942,7 +6942,7 @@ static int iwl_mac_add_interface(struct
if (priv->interface_id) {
IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
- return 0;
+ return -EOPNOTSUPP;
}
spin_lock_irqsave(&priv->lock, flags);
--- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-11-26 23:23:36.929050673 +0100
+++ linux-2.6/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-11-26 23:23:45.039044868 +0100
@@ -7332,7 +7332,7 @@ static int iwl_mac_add_interface(struct
if (priv->interface_id) {
IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
- return 0;
+ return -EOPNOTSUPP;
}
spin_lock_irqsave(&priv->lock, flags);
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH (2.6.24) 2/3] mac80211: support devices/drivers that cannot change MAC address
[not found] <20071126225416.467939000@sipsolutions.net>
2007-11-26 22:54 ` [PATCH (2.6.24) 1/3] iwlwifi: fix add_interface Johannes Berg
@ 2007-11-26 22:54 ` Johannes Berg
2007-11-26 22:54 ` [PATCH (2.6.24) 3/3] iwlwifi: do not allow MAC address change Johannes Berg
2007-11-27 14:54 ` [PATCH (2.6.24) 0/3] last minute iwlwifi fixes Tomas Winkler
3 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2007-11-26 22:54 UTC (permalink / raw)
To: John Linville; +Cc: Zhu Yi, Michael Wu, Reinette Chatre, linux-wireless
The iwlwifi drivers do not allow changing the MAC address (because the
drivers ignore the MAC address mac80211 gives them). So far I haven't
been successful in making them not ignore it, so this adds mac80211
support for allowing them to disable MAC changing completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Wu <flamingice@sourmilk.net>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
---
include/net/mac80211.h | 4 ++++
net/mac80211/ieee80211_iface.c | 7 +++++++
2 files changed, 11 insertions(+)
--- linux-2.6.orig/include/net/mac80211.h 2007-11-26 23:41:22.279045140 +0100
+++ linux-2.6/include/net/mac80211.h 2007-11-26 23:41:26.219045031 +0100
@@ -662,12 +662,16 @@ enum sta_notify_cmd {
* @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED:
* Channels are already configured to the default regulatory domain
* specified in the device's EEPROM
+ *
+ * @IEEE80211_HW_NO_MAC_CHANGE_SUPPORT: hardware (or driver) does not
+ * support changing MAC address away from the pre-programmed one
*/
enum ieee80211_hw_flags {
IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3,
+ IEEE80211_HW_NO_MAC_CHANGE_SUPPORT = 1<<4,
};
/**
--- linux-2.6.orig/net/mac80211/ieee80211_iface.c 2007-11-26 23:41:22.189044543 +0100
+++ linux-2.6/net/mac80211/ieee80211_iface.c 2007-11-26 23:43:56.529066679 +0100
@@ -38,6 +38,11 @@ static void ieee80211_if_sdata_deinit(st
}
}
+static int ieee80211_no_change_mac(struct net_device *dev, void *p)
+{
+ return -EOPNOTSUPP;
+}
+
/* Must be called with rtnl lock held. */
int ieee80211_if_add(struct net_device *dev, const char *name,
struct net_device **new_dev, int type)
@@ -63,6 +68,8 @@ int ieee80211_if_add(struct net_device *
ndev->mem_start = dev->mem_start;
ndev->mem_end = dev->mem_end;
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
+ if (local->hw.flags & IEEE80211_HW_NO_MAC_CHANGE_SUPPORT)
+ ndev->set_mac_address = ieee80211_no_change_mac;
sdata = IEEE80211_DEV_TO_SUB_IF(ndev);
ndev->ieee80211_ptr = &sdata->wdev;
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH (2.6.24) 3/3] iwlwifi: do not allow MAC address change
[not found] <20071126225416.467939000@sipsolutions.net>
2007-11-26 22:54 ` [PATCH (2.6.24) 1/3] iwlwifi: fix add_interface Johannes Berg
2007-11-26 22:54 ` [PATCH (2.6.24) 2/3] mac80211: support devices/drivers that cannot change MAC address Johannes Berg
@ 2007-11-26 22:54 ` Johannes Berg
2007-11-27 14:54 ` [PATCH (2.6.24) 0/3] last minute iwlwifi fixes Tomas Winkler
3 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2007-11-26 22:54 UTC (permalink / raw)
To: John Linville; +Cc: Zhu Yi, Reinette Chatre, linux-wireless
The iwlwifi drivers do not allow changing the MAC address (because the
drivers ignore the MAC address mac80211 gives them). So far I haven't
been successful in making them not ignore it, so this makes them tell
mac80211 that they cannot change the MAC address which will disable
MAC changing completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
---
drivers/net/wireless/iwlwifi/iwl3945-base.c | 3 ++-
drivers/net/wireless/iwlwifi/iwl4965-base.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
--- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-11-26 23:35:47.519044815 +0100
+++ linux-2.6/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-11-26 23:35:54.929043078 +0100
@@ -8381,7 +8381,8 @@ static int iwl_pci_probe(struct pci_dev
hw->max_signal = 100; /* link quality indication (%) */
/* Tell mac80211 our Tx characteristics */
- hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
+ hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+ IEEE80211_HW_NO_MAC_CHANGE_SUPPORT;
hw->queues = 4;
--- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-11-26 23:35:17.379044217 +0100
+++ linux-2.6/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-11-26 23:35:43.209044760 +0100
@@ -8983,7 +8983,8 @@ static int iwl_pci_probe(struct pci_dev
hw->max_signal = 100; /* link quality indication (%) */
/* Tell mac80211 our Tx characteristics */
- hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE;
+ hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
+ IEEE80211_HW_NO_MAC_CHANGE_SUPPORT;
hw->queues = 4;
#ifdef CONFIG_IWLWIFI_HT
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
[not found] <20071126225416.467939000@sipsolutions.net>
` (2 preceding siblings ...)
2007-11-26 22:54 ` [PATCH (2.6.24) 3/3] iwlwifi: do not allow MAC address change Johannes Berg
@ 2007-11-27 14:54 ` Tomas Winkler
2007-11-27 14:57 ` Johannes Berg
3 siblings, 1 reply; 9+ messages in thread
From: Tomas Winkler @ 2007-11-27 14:54 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless
In general it is possible to change the mac address and there was a
patch for it if I remember correctly. It had some issues so I nacked
it, it slipped from my attention after that. I'll try to dig the
history.
Tomas
On Nov 27, 2007 12:54 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> So I took another look at iwlwifi and identified a bunch of user-visible
> problems with the drivers. Unfortunately, I was unable to fix one of them
> (MAC address setting ignored) so I added a workaround. I've repeatedly
> pointed out that iwlwifi needs fixing here but I guess for .24 we'll just
> have to live with not being able to change the MAC address.
>
> johannes
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
2007-11-27 14:54 ` [PATCH (2.6.24) 0/3] last minute iwlwifi fixes Tomas Winkler
@ 2007-11-27 14:57 ` Johannes Berg
2007-11-27 16:00 ` Tomas Winkler
0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2007-11-27 14:57 UTC (permalink / raw)
To: Tomas Winkler; +Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 618 bytes --]
On Tue, 2007-11-27 at 16:54 +0200, Tomas Winkler wrote:
> In general it is possible to change the mac address and there was a
> patch for it if I remember correctly. It had some issues so I nacked
> it, it slipped from my attention after that. I'll try to dig the
> history.
Thanks. I didn't feel confident enough with the driver to make such a
change since I have no idea where it should/would be uploaded to the
hardware and whether maybe the ucode gets it from the eeprom too etc.
If you can get a patch that makes this work I'm all for it since the
mac80211 hack isn't too nice anyway.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
2007-11-27 14:57 ` Johannes Berg
@ 2007-11-27 16:00 ` Tomas Winkler
2007-11-27 16:04 ` Johannes Berg
0 siblings, 1 reply; 9+ messages in thread
From: Tomas Winkler @ 2007-11-27 16:00 UTC (permalink / raw)
To: Johannes Berg
Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless,
Ian Schram
On Nov 27, 2007 4:57 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2007-11-27 at 16:54 +0200, Tomas Winkler wrote:
> > In general it is possible to change the mac address and there was a
> > patch for it if I remember correctly. It had some issues so I nacked
> > it, it slipped from my attention after that. I'll try to dig the
> > history.
>
> Thanks. I didn't feel confident enough with the driver to make such a
> change since I have no idea where it should/would be uploaded to the
> hardware and whether maybe the ucode gets it from the eeprom too etc.
>
> If you can get a patch that makes this work I'm all for it since the
> mac80211 hack isn't too nice anyway.
>
I found it, there was a patch by Ian Schram <ischram@telenet.be>
'[PATCH] allow changing mac_addr by userspace'
It should work I nacked it just because I wanted to remove a filed he
was using, it never happened so I think we can apply it
for 24 and then I get back to rework it.
I'll resend it rebased to current everything.
> johannes
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
2007-11-27 16:00 ` Tomas Winkler
@ 2007-11-27 16:04 ` Johannes Berg
2007-11-27 16:06 ` Tomas Winkler
0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2007-11-27 16:04 UTC (permalink / raw)
To: Tomas Winkler
Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless,
Ian Schram
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
On Tue, 2007-11-27 at 18:00 +0200, Tomas Winkler wrote:
> I found it, there was a patch by Ian Schram <ischram@telenet.be>
> '[PATCH] allow changing mac_addr by userspace'
> It should work I nacked it just because I wanted to remove a filed he
> was using, it never happened so I think we can apply it
> for 24 and then I get back to rework it.
> I'll resend it rebased to current everything.
Great, thanks. Actually, John will probably prefer if you send him a
version against .24 as well. John, please drop 2 and 3 of this series
then in favour of that patch.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
2007-11-27 16:04 ` Johannes Berg
@ 2007-11-27 16:06 ` Tomas Winkler
2007-11-27 16:08 ` Johannes Berg
0 siblings, 1 reply; 9+ messages in thread
From: Tomas Winkler @ 2007-11-27 16:06 UTC (permalink / raw)
To: Johannes Berg
Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless,
Ian Schram
sorry for stupid question but what is the git for 24.?
On Nov 27, 2007 6:04 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2007-11-27 at 18:00 +0200, Tomas Winkler wrote:
>
> > I found it, there was a patch by Ian Schram <ischram@telenet.be>
> > '[PATCH] allow changing mac_addr by userspace'
> > It should work I nacked it just because I wanted to remove a filed he
> > was using, it never happened so I think we can apply it
> > for 24 and then I get back to rework it.
> > I'll resend it rebased to current everything.
>
> Great, thanks. Actually, John will probably prefer if you send him a
> version against .24 as well. John, please drop 2 and 3 of this series
> then in favour of that patch.
>
> johannes
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH (2.6.24) 0/3] last minute iwlwifi fixes
2007-11-27 16:06 ` Tomas Winkler
@ 2007-11-27 16:08 ` Johannes Berg
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2007-11-27 16:08 UTC (permalink / raw)
To: Tomas Winkler
Cc: John Linville, Zhu Yi, Reinette Chatre, linux-wireless,
Ian Schram
[-- Attachment #1: Type: text/plain, Size: 295 bytes --]
On Tue, 2007-11-27 at 18:06 +0200, Tomas Winkler wrote:
> sorry for stupid question but what is the git for 24.?
I don't think we have anything pending in git or I guess John would
probably call it upstream-fixes-jgarzik or something. I diff against
Linus's tree right now.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-11-27 16:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20071126225416.467939000@sipsolutions.net>
2007-11-26 22:54 ` [PATCH (2.6.24) 1/3] iwlwifi: fix add_interface Johannes Berg
2007-11-26 22:54 ` [PATCH (2.6.24) 2/3] mac80211: support devices/drivers that cannot change MAC address Johannes Berg
2007-11-26 22:54 ` [PATCH (2.6.24) 3/3] iwlwifi: do not allow MAC address change Johannes Berg
2007-11-27 14:54 ` [PATCH (2.6.24) 0/3] last minute iwlwifi fixes Tomas Winkler
2007-11-27 14:57 ` Johannes Berg
2007-11-27 16:00 ` Tomas Winkler
2007-11-27 16:04 ` Johannes Berg
2007-11-27 16:06 ` Tomas Winkler
2007-11-27 16:08 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).