From patchwork Wed May 18 10:11:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ignacy Gawedzki X-Patchwork-Id: 793302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4IAGPNO020059 for ; Wed, 18 May 2011 10:16:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756877Ab1ERKLW (ORCPT ); Wed, 18 May 2011 06:11:22 -0400 Received: from qult.net ([82.238.217.46]:50380 "EHLO qult.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755466Ab1ERKLW (ORCPT ); Wed, 18 May 2011 06:11:22 -0400 Received: from zenon.in.qult.net ([192.168.128.3]) by qult.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1QMdip-0002Zb-EM; Wed, 18 May 2011 12:11:19 +0200 Received: from ig by zenon.in.qult.net with local (Exim 4.74) (envelope-from ) id 1QMdim-00041Q-W8; Wed, 18 May 2011 12:11:16 +0200 Date: Wed, 18 May 2011 12:11:16 +0200 From: Ignacy Gawedzki To: George Nychis Cc: linux-wireless@vger.kernel.org Subject: Re: [BUG] ath9k_htc: new devices get name wlan%d if not in rules Message-ID: <20110518101116.GA14900@zenon.in.qult.net> Mail-Followup-To: Ignacy Gawedzki , George Nychis , linux-wireless@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 18 May 2011 10:16:25 +0000 (UTC) On Tue, May 17, 2011 at 03:33:34PM -0400, thus spake George Nychis: > I haven't narrowed it down to the exact build date where this breaks, > but I know that it works in compat-wireless-2011-05-01, and not in > compat-wireless-2011-05-11+ (including last night's build). I had > trouble building compat-wireless-2011-05-04/05 so it was hard for me > to narrow it down. The parsing of the format of interface name has been reworked in some recent commit in the kernel. Consequently, several calls to dev_alloc_name (which does the actual parsing of the format string and allocation of a number) have been removed from several kernel components and the parsing and number allocation is done in some unique common place down the road. The problem is, compat-wireless doesn't add this bit of "common place" code, but still removes the original calls to dev_alloc_name. This is something that should be added to compat/, but in the meantime, you can apply the attached patch. Ignacy diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 8531915..27264de 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1173,6 +1173,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM; #endif + ret = dev_alloc_name(ndev, ndev->name); + if (ret < 0) + goto fail; + ieee80211_assign_perm_addr(local, ndev, type); memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN); SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));