netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* d80211: RFC: divide by zero when hw->maxssi not set
@ 2006-11-17 23:51 David Kimdon
  2006-11-17 23:59 ` Michael Wu
  2006-11-19 23:55 ` Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: David Kimdon @ 2006-11-17 23:51 UTC (permalink / raw)
  To: Larry Finger; +Cc: netdev

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

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

* Re: d80211: RFC: divide by zero when hw->maxssi not set
  2006-11-17 23:51 d80211: RFC: divide by zero when hw->maxssi not set David Kimdon
@ 2006-11-17 23:59 ` Michael Wu
  2006-11-19 23:55 ` Dan Williams
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Wu @ 2006-11-17 23:59 UTC (permalink / raw)
  To: David Kimdon; +Cc: Larry Finger, netdev

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

On Friday 17 November 2006 18:51, David Kimdon wrote:
> - 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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: d80211: RFC: divide by zero when hw->maxssi not set
  2006-11-17 23:51 d80211: RFC: divide by zero when hw->maxssi not set David Kimdon
  2006-11-17 23:59 ` Michael Wu
@ 2006-11-19 23:55 ` Dan Williams
  2006-11-20 12:45   ` Ingo Oeser
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Williams @ 2006-11-19 23:55 UTC (permalink / raw)
  To: David Kimdon; +Cc: Larry Finger, netdev

On Fri, 2006-11-17 at 15:51 -0800, David Kimdon wrote:
> 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

> -David
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" 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] 4+ messages in thread

* Re: d80211: RFC: divide by zero when hw->maxssi not set
  2006-11-19 23:55 ` Dan Williams
@ 2006-11-20 12:45   ` Ingo Oeser
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Oeser @ 2006-11-20 12:45 UTC (permalink / raw)
  To: Dan Williams; +Cc: David Kimdon, Larry Finger, netdev

Hi there,

Dan Williams schrieb:
> On Fri, 2006-11-17 at 15:51 -0800, David Kimdon wrote:
> > 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

> #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

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

end of thread, other threads:[~2006-11-20 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-17 23:51 d80211: RFC: divide by zero when hw->maxssi not set David Kimdon
2006-11-17 23:59 ` Michael Wu
2006-11-19 23:55 ` Dan Williams
2006-11-20 12:45   ` Ingo Oeser

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