Skip to contentSkip to conversation

d80211: RFC: divide by zero when hw->maxssi not set

DISCUSSION David Kimdon 4 participants 4 messages Nov 17, 2006 – Nov 20, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

commit 448bf25bc9e3d70a211fdf235426472089371c43 added ieee80211_get_wireless_stats in net/d80211/ieee80211_ioctl.c. At present we get a divide by zero (oops) if the low level driver does not set the new hw->maxssi field. Perhaps:

- reject registration of devices which do not set maxssi
- do not attempt to report link quality for drivers which do not set maxssi
- other ideas?

-David

#1 lore raw
Quoted 5 lines · David Kimdon

- reject registration of devices which do not set maxssi
- do not attempt to report link quality for drivers which do not set maxssi
- other ideas?

I've noticed that too. p54 didn't get a driver update when maxssi was added. I don't mind adding a dummy maxssi just to make sure we don't divide by zero. In fact, I'm going to come up with a patch for p54 to do that soon.

-Michael Wu

#2 lore raw
In reply to David Kimdon
Quoted 11 lines · David Kimdon

Hi,

commit 448bf25bc9e3d70a211fdf235426472089371c43 added ieee80211_get_wireless_stats in net/d80211/ieee80211_ioctl.c. At present we get a divide by zero (oops) if the low level driver does not set the new hw->maxssi field. Perhaps:

- reject registration of devices which do not set maxssi
- do not attempt to report link quality for drivers which do not set maxssi
- other ideas?

#1 could be too draconian, but has the benefit of making driver writers put _something_ there. Either way, it's pretty obvious to anyone that the driver is broken for quality reporting. But at least #1 forces the issue to making quality somewhat work.

Dan

Quoted 5 lines
(quoted diff) +0 -2
-David
-

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Hi there,

Quoted 6 lines · Dan Williams
Quoted 5 lines · David Kimdon

commit 448bf25bc9e3d70a211fdf235426472089371c43 added ieee80211_get_wireless_stats in net/d80211/ieee80211_ioctl.c. At present we get a divide by zero (oops) if the low level driver does not set the new hw->maxssi field. Perhaps:

Quoted 6 lines
Quoted 1 line

- reject registration of devices which do not set maxssi

#1 could be too draconian, but has the benefit of making driver writers put _something_ there. Either way, it's pretty obvious to anyone that the driver is broken for quality reporting. But at least #1 forces the issue to making quality somewhat work.

Looks like a perfect cancdidate for -EINVAL and WARN_ON() at registration. BUG_ON() is also ok, until that stuff is widely deployed.

That's much better than dummy values, because it doesn't make people think "Hmm, it works somehow, but I don't know why (and I don't care why)".

Regards

Ingo Oeser