linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] softmac: use list_for_each_entry
@ 2007-05-27 14:27 Akinobu Mita
  2007-05-31 20:24 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Akinobu Mita @ 2007-05-27 14:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Johannes Berg, Joe Jezak, Daniel Drake

Cleanup using list_for_each_entry.

Cc: John W. Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Joe Jezak <josejx@gentoo.org>
Cc: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 net/ieee80211/softmac/ieee80211softmac_module.c |   32 ++++++++----------------
 1 file changed, 11 insertions(+), 21 deletions(-)

Index: 2.6-mm/net/ieee80211/softmac/ieee80211softmac_module.c
===================================================================
--- 2.6-mm.orig/net/ieee80211/softmac/ieee80211softmac_module.c
+++ 2.6-mm/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -456,18 +456,13 @@ void
 ieee80211softmac_add_network_locked(struct ieee80211softmac_device *mac,
 	struct ieee80211softmac_network *add_net)
 {
-	struct list_head *list_ptr;
-	struct ieee80211softmac_network *softmac_net = NULL;
+	struct ieee80211softmac_network *softmac_net;
 
-	list_for_each(list_ptr, &mac->network_list) {
-		softmac_net = list_entry(list_ptr, struct ieee80211softmac_network, list);
+	list_for_each_entry(softmac_net, &mac->network_list, list) {
 		if(!memcmp(softmac_net->bssid, add_net->bssid, ETH_ALEN))
-			break;
-		else
-			softmac_net = NULL;
+			return;
 	}
-	if(softmac_net == NULL)
-		list_add(&(add_net->list), &mac->network_list);
+	list_add(&(add_net->list), &mac->network_list);
 }
 
 /* Add a network to the list, with locking */
@@ -506,16 +501,13 @@ struct ieee80211softmac_network *
 ieee80211softmac_get_network_by_bssid_locked(struct ieee80211softmac_device *mac,
 	u8 *bssid)
 {
-	struct list_head *list_ptr;
-	struct ieee80211softmac_network *softmac_net = NULL;
-	list_for_each(list_ptr, &mac->network_list) {
-		softmac_net = list_entry(list_ptr, struct ieee80211softmac_network, list);
+	struct ieee80211softmac_network *softmac_net;
+
+	list_for_each_entry(softmac_net, &mac->network_list, list) {
 		if(!memcmp(softmac_net->bssid, bssid, ETH_ALEN))
-			break;
-		else
-			softmac_net = NULL;
+			return softmac_net;
 	}
-	return softmac_net;
+	return NULL;
 }
 
 /* Get a network from the list by BSSID with locking */
@@ -537,11 +529,9 @@ struct ieee80211softmac_network *
 ieee80211softmac_get_network_by_essid_locked(struct ieee80211softmac_device *mac,
 	struct ieee80211softmac_essid *essid)
 {
-	struct list_head *list_ptr;
-	struct ieee80211softmac_network *softmac_net = NULL;
+	struct ieee80211softmac_network *softmac_net;
 
-	list_for_each(list_ptr, &mac->network_list) {
-		softmac_net = list_entry(list_ptr, struct ieee80211softmac_network, list);
+	list_for_each_entry(softmac_net, &mac->network_list, list) {
 		if (softmac_net->essid.len == essid->len &&
 			!memcmp(softmac_net->essid.data, essid->data, essid->len))
 			return softmac_net;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-05-27 14:27 [PATCH] softmac: use list_for_each_entry Akinobu Mita
@ 2007-05-31 20:24 ` Johannes Berg
  2007-06-01 15:59   ` Larry Finger
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2007-05-31 20:24 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-wireless, John W. Linville, Joe Jezak, Daniel Drake

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On Sun, 2007-05-27 at 23:27 +0900, Akinobu Mita wrote:
> Cleanup using list_for_each_entry.

> This patch adds missing NULL check and trims a line longer than 80
> columns.

Both patches look good to me but I do wonder why you're actually looking
at this code :)

I sure hope somebody will port bcm43xx driver to mac80211 (again) soon
so we can remove softmac.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-05-31 20:24 ` Johannes Berg
@ 2007-06-01 15:59   ` Larry Finger
  2007-06-01 19:12     ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Finger @ 2007-06-01 15:59 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Akinobu Mita, linux-wireless, John W. Linville, Joe Jezak,
	Daniel Drake

Johannes,

Johannes Berg wrote:
> On Sun, 2007-05-27 at 23:27 +0900, Akinobu Mita wrote:
>> Cleanup using list_for_each_entry.
> 
>> This patch adds missing NULL check and trims a line longer than 80
>> columns.
> 
> Both patches look good to me but I do wonder why you're actually looking
> at this code :)
> 
> I sure hope somebody will port bcm43xx driver to mac80211 (again) soon
> so we can remove softmac.

As it is impossible to predict how long until we can remove softmac, such patches should be 
accepted. You understand that I'm not looking for problems in softmac.

As we discussed earlier, bcm43xx-softmac has to be ported to mac80211 to support 802.11b-only cards, 
as the V4 firmware does not accommodate them. I had started this project by changing the namespace 
to bcm4301. That patch went into Linville's wireless-dev pending list. I then started learning the 
interface to mac80211. For a number of reasons, that step was going slowly. Michael Wu recently 
offered to take over, which seemed reasonable given his familiarity with mac80211.

When Michael Wu gets a version of bcm4301-mac80211 that compiles cleanly, I will be testing it as he 
doesn't have the hardware. For my testing purposes, the 802.11g stuff will still be there. Once I 
get it working, I plan to post a patch to get as much testing as possible.

In the earlier discussion, we also concluded that the product of a conversion from softmac to 
mac80211 should not be included in mainline, with the exception of the b-only code. Depending on how 
long the port and testing take, and the state of bcm43xx-mac80211 at that time, a reversal of that 
earlier decision may be in order.

Larry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-06-01 15:59   ` Larry Finger
@ 2007-06-01 19:12     ` Johannes Berg
  2007-06-11 19:18       ` John W. Linville
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2007-06-01 19:12 UTC (permalink / raw)
  To: Larry Finger
  Cc: Akinobu Mita, linux-wireless, John W. Linville, Joe Jezak,
	Daniel Drake

[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]

On Fri, 2007-06-01 at 10:59 -0500, Larry Finger wrote:

> As it is impossible to predict how long until we can remove softmac, such patches should be 
> accepted.

Oh of course! I do agree with both patches, I hope they're applied. If
you want:
Acked-by: Johannes Berg <johannes@sipsolutions.net>

> As we discussed earlier, bcm43xx-softmac has to be ported to mac80211 to support 802.11b-only cards, 
> as the V4 firmware does not accommodate them. I had started this project by changing the namespace 
> to bcm4301. That patch went into Linville's wireless-dev pending list. I then started learning the 
> interface to mac80211. For a number of reasons, that step was going slowly. Michael Wu recently 
> offered to take over, which seemed reasonable given his familiarity with mac80211.
> 
> When Michael Wu gets a version of bcm4301-mac80211 that compiles cleanly, I will be testing it as he 
> doesn't have the hardware. For my testing purposes, the 802.11g stuff will still be there. Once I 
> get it working, I plan to post a patch to get as much testing as possible..
> 
> In the earlier discussion, we also concluded that the product of a conversion from softmac to 
> mac80211 should not be included in mainline, with the exception of the b-only code. Depending on how 
> long the port and testing take, and the state of bcm43xx-mac80211 at that time, a reversal of that 
> earlier decision may be in order.

I'd think that once somebody has time for it both port and testing
should go pretty soon, and I'd think that we can do that sooner than fix
the current bcm43xx-mac80211, in which case IMHO the result should be
included in mainline seeing that zd1211rw will probably be ready for
mac80211 in the .23 timeframe. That means that at that point we might
even be able to drop softmac already if the second straightforward (here
I mean without any other changes to the driver) bcm43xx port is ready :)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-06-01 19:12     ` Johannes Berg
@ 2007-06-11 19:18       ` John W. Linville
  2007-06-11 20:06         ` John W. Linville
  2007-06-11 20:14         ` Larry Finger
  0 siblings, 2 replies; 7+ messages in thread
From: John W. Linville @ 2007-06-11 19:18 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Larry Finger, Akinobu Mita, linux-wireless, Joe Jezak,
	Daniel Drake

On Fri, Jun 01, 2007 at 09:12:49PM +0200, Johannes Berg wrote:
> On Fri, 2007-06-01 at 10:59 -0500, Larry Finger wrote:

> > In the earlier discussion, we also concluded that the product of a conversion from softmac to 
> > mac80211 should not be included in mainline, with the exception of the b-only code. Depending on how 
> > long the port and testing take, and the state of bcm43xx-mac80211 at that time, a reversal of that 
> > earlier decision may be in order.
> 
> I'd think that once somebody has time for it both port and testing
> should go pretty soon, and I'd think that we can do that sooner than fix
> the current bcm43xx-mac80211, in which case IMHO the result should be
> included in mainline seeing that zd1211rw will probably be ready for
> mac80211 in the .23 timeframe. That means that at that point we might
> even be able to drop softmac already if the second straightforward (here
> I mean without any other changes to the driver) bcm43xx port is ready :)

FWIW, I would like to see a mac80211-based port of the current
bcm43xx driver available as soon as it is ready, without waiting to
strip-out the non-b portions.  This should help us abandon softmac
as soon as possible.

Plus, we may need to consider preserving the driver in its current
form (aside from the softmac -> mac80211 port) for some time as a
compatibility aid for those who already have working configurations
with the "bcm43xx" driver.  Forcing a happy user to locate new firmware
for no obvious benefit to them is not very nice (as I have learned
so well w/ Fedora 7)...

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-06-11 19:18       ` John W. Linville
@ 2007-06-11 20:06         ` John W. Linville
  2007-06-11 20:14         ` Larry Finger
  1 sibling, 0 replies; 7+ messages in thread
From: John W. Linville @ 2007-06-11 20:06 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Larry Finger, Akinobu Mita, linux-wireless, Joe Jezak,
	Daniel Drake

On Mon, Jun 11, 2007 at 03:18:54PM -0400, John W. Linville wrote:

> Plus, we may need to consider preserving the driver in its current
> form (aside from the softmac -> mac80211 port) for some time as a
> compatibility aid for those who already have working configurations
> with the "bcm43xx" driver.  Forcing a happy user to locate new firmware
> for no obvious benefit to them is not very nice (as I have learned
> so well w/ Fedora 7)...

As a re-read this, it seems subject to misinterpretation.  I mean
that once the existing bcm43xx driver (11g bits and all) is ported to
mac80211, we may want to keep the 11g bits even after the existing
bcm43xx-mac80211 (using v4 firmware) driver has been ported.
Worth considering...

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] softmac: use list_for_each_entry
  2007-06-11 19:18       ` John W. Linville
  2007-06-11 20:06         ` John W. Linville
@ 2007-06-11 20:14         ` Larry Finger
  1 sibling, 0 replies; 7+ messages in thread
From: Larry Finger @ 2007-06-11 20:14 UTC (permalink / raw)
  To: John W. Linville
  Cc: Johannes Berg, Akinobu Mita, linux-wireless, Joe Jezak,
	Daniel Drake

John W. Linville wrote:
> On Fri, Jun 01, 2007 at 09:12:49PM +0200, Johannes Berg wrote:
>> On Fri, 2007-06-01 at 10:59 -0500, Larry Finger wrote:
> 
>>> In the earlier discussion, we also concluded that the product of a conversion from softmac to 
>>> mac80211 should not be included in mainline, with the exception of the b-only code. Depending on how 
>>> long the port and testing take, and the state of bcm43xx-mac80211 at that time, a reversal of that 
>>> earlier decision may be in order.
>> I'd think that once somebody has time for it both port and testing
>> should go pretty soon, and I'd think that we can do that sooner than fix
>> the current bcm43xx-mac80211, in which case IMHO the result should be
>> included in mainline seeing that zd1211rw will probably be ready for
>> mac80211 in the .23 timeframe. That means that at that point we might
>> even be able to drop softmac already if the second straightforward (here
>> I mean without any other changes to the driver) bcm43xx port is ready :)
> 
> FWIW, I would like to see a mac80211-based port of the current
> bcm43xx driver available as soon as it is ready, without waiting to
> strip-out the non-b portions.  This should help us abandon softmac
> as soon as possible.
> 
> Plus, we may need to consider preserving the driver in its current
> form (aside from the softmac -> mac80211 port) for some time as a
> compatibility aid for those who already have working configurations
> with the "bcm43xx" driver.  Forcing a happy user to locate new firmware
> for no obvious benefit to them is not very nice (as I have learned
> so well w/ Fedora 7)...

I agree that we should do a port of the current bcm43xx driver to mac80211 ASAP. I also believe that 
it needs to include the non-b portions, particularly for the initial testing, but I have no 
objections to leaving it intact, at least until the new driver is better at operations.

Michael Wu offered to do the initial port, but I don't know what his progress has been.

Larry

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-11 20:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-27 14:27 [PATCH] softmac: use list_for_each_entry Akinobu Mita
2007-05-31 20:24 ` Johannes Berg
2007-06-01 15:59   ` Larry Finger
2007-06-01 19:12     ` Johannes Berg
2007-06-11 19:18       ` John W. Linville
2007-06-11 20:06         ` John W. Linville
2007-06-11 20:14         ` Larry Finger

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).