svn commit: r220105 - head/sys/netinet

2011-03-28 Thread Weongyo Jeong
Author: weongyo
Date: Mon Mar 28 19:03:56 2011
New Revision: 220105
URL: http://svn.freebsd.org/changeset/base/220105

Log:
  Covers values if (BYTES_THIS_ACK(tp, th) / tp-t_maxseg) value is from
  2.0 to 3.0.
  
  Reviewed by:  lstewart

Modified:
  head/sys/netinet/tcp_sack.c

Modified: head/sys/netinet/tcp_sack.c
==
--- head/sys/netinet/tcp_sack.c Mon Mar 28 17:41:10 2011(r220104)
+++ head/sys/netinet/tcp_sack.c Mon Mar 28 19:03:56 2011(r220105)
@@ -577,7 +577,7 @@ tcp_sack_partialack(struct tcpcb *tp, st
tcp_timer_activate(tp, TT_REXMT, 0);
tp-t_rtttime = 0;
/* Send one or 2 segments based on how much new data was acked. */
-   if ((BYTES_THIS_ACK(tp, th) / tp-t_maxseg)  2)
+   if ((BYTES_THIS_ACK(tp, th) / tp-t_maxseg) = 2)
num_segs = 2;
tp-snd_cwnd = (tp-sackhint.sack_bytes_rexmit +
(tp-snd_nxt - tp-sack_newdata) + num_segs * tp-t_maxseg);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r217358 - head/usr.sbin/usbdump

2011-01-26 Thread Weongyo Jeong
On Thu, Jan 13, 2011 at 04:37:12PM +, Weongyo Jeong wrote:
 Author: weongyo
 Date: Thu Jan 13 16:37:12 2011
 New Revision: 217358
 URL: http://svn.freebsd.org/changeset/base/217358
 
 Log:
   Documents OUTPUT formats.  While I'm here cleans up styles and words.
   
   Reviewed by:brueffer@

Some corrections that cleaning styles and words were done by brueffer@.

regards,
Weongyo Jeong

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r217358 - head/usr.sbin/usbdump

2011-01-13 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jan 13 16:37:12 2011
New Revision: 217358
URL: http://svn.freebsd.org/changeset/base/217358

Log:
  Documents OUTPUT formats.  While I'm here cleans up styles and words.
  
  Reviewed by:  brueffer@

Modified:
  head/usr.sbin/usbdump/usbdump.8

Modified: head/usr.sbin/usbdump/usbdump.8
==
--- head/usr.sbin/usbdump/usbdump.8 Thu Jan 13 16:29:27 2011
(r217357)
+++ head/usr.sbin/usbdump/usbdump.8 Thu Jan 13 16:37:12 2011
(r217358)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 14, 2010
+.Dd December 4, 2010
 .Dt usbdump 8
 .Os
 .Sh NAME
@@ -41,24 +41,29 @@
 .Sh DESCRIPTION
 The
 .Nm
-utility provides a way to dump USB packets on each host controller.
+utility provides a way to dump USB packets on host controllers.
 .Pp
-The following options are accepted.
+The following options are accepted:
 .Bl -tag -width .Fl f Ar file
 .It Fl i Ar ifname
-Listen on USB bus interface.
+Listen on USB bus interface
+.Ar ifname .
 .It Fl r Ar file
-Read the raw packets from file.
+Read the raw packets from
+.Ar file .
 .It Fl s Ar snaplen
-Snapshot bytes from each packet.
+Snapshot
+.Ar snaplen
+bytes from each packet.
 .It Fl v
 Enable debugging messages.
-When it defined multiple times the verbose level increases.
+When defined multiple times the verbosity level increases.
 .It Fl w Ar file
-Write the raw packets to file.
+Write the raw packets to
+.Ar file .
 .El
 .Sh EXAMPLES
-Captures the USB raw packets alive on usbus2:
+Captures USB raw packets on usbus2:
 .Pp
 .Dl usbdump -i usbus2 -s 256 -v
 .Pp
@@ -67,11 +72,61 @@ size limit:
 .Pp
 .Dl usbdump -i usbus2 -s 0 -w /tmp/dump_pkts
 .Pp
-Read the USB raw packets from the file:
+Read the USB raw packets from previous file:
 .Pp
 .Dl usbdump -r /tmp/dump_pkts -v
+.Sh OUTPUT FORMAT
+The output format of
+.Nm
+is as follows:
+.Pp
+.Dl time bus.addr ep xfertype S/D (frames/length) ...
+.Pp
+The meaning of the output format elements is as follows:
+.Bl -tag -width xfertype
+.It time
+A timestamp preceding all output lines.
+The timestamp has the format hh:mm:ss.frac and is as accurate as
+the kernel's clock.
+.It bus
+The USB host controller's bus unit number.
+.It addr
+The unique number of the USB device as allocated by the host controller driver.
+.It ep
+The USB endpoint address that indicates whether the address is
+.Dv OUT
+or
+.Dv IN .
+.It xfertype
+The USB transfer type.
+Can be
+.Dv CTRL ,
+.Dv ISOC ,
+.Dv BULK
+or
+.Dv INTR .
+.It S/D
+`S' indicates a USB submit.
+`D' indicates a USB transfer done.
+.It frames
+Numbers of frames in this packets.
+If this is a USB submit, its value is
+.Li xfer-nframes
+which means how many frames are acceptable or registered to transfer.
+If this is a USB done,
+.Li xfer-aframes
+is the actual number of frames.
+.It length
+Total packet size.
+If this is a USB submit, its value is
+.Li xfer-sumlen .
+If this is a USB done, its value is
+.Li xfer-actlen .
+.It ...
+Optional field used for printing an error string if the packet is from USB 
done.
+.El
 .Sh SEE ALSO
 .Xr usbconfig 8
 .Sh AUTHORS
 .An Weongyo Jeong
-.Aq weon...@freebsd.org .
+.Aq weon...@freebsd.org
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r216267 - in head: sbin/ifconfig sys/dev/usb sys/net

2010-12-07 Thread Weongyo Jeong
Author: weongyo
Date: Tue Dec  7 20:23:47 2010
New Revision: 216267
URL: http://svn.freebsd.org/changeset/base/216267

Log:
  Introduces IFF_CANTCONFIG interface flag to point that the interface
  isn't configurable in a meaningful way.  This is for ifconfig(8) or
  other tools not to change code whenever IFT_USB-like interfaces are
  registered at the interface list.
  
  Reviewed by:  brooks
  No objections:gavin, jkim

Modified:
  head/sbin/ifconfig/ifconfig.c
  head/sys/dev/usb/usb_pf.c
  head/sys/net/if.h

Modified: head/sbin/ifconfig/ifconfig.c
==
--- head/sbin/ifconfig/ifconfig.c   Tue Dec  7 19:18:00 2010
(r216266)
+++ head/sbin/ifconfig/ifconfig.c   Tue Dec  7 20:23:47 2010
(r216267)
@@ -295,8 +295,6 @@ main(int argc, char *argv[])
sdl = (const struct sockaddr_dl *) ifa-ifa_addr;
else
sdl = NULL;
-   if (sdl != NULL  sdl-sdl_type == IFT_USB)
-   continue;
if (cp != NULL  strcmp(cp, ifa-ifa_name) == 0  !namesonly)
continue;
iflen = strlcpy(name, ifa-ifa_name, sizeof(name));
@@ -307,6 +305,8 @@ main(int argc, char *argv[])
}
cp = ifa-ifa_name;
 
+   if ((ifa-ifa_flags  IFF_CANTCONFIG) != 0)
+   continue;
if (downonly  (ifa-ifa_flags  IFF_UP) != 0)
continue;
if (uponly  (ifa-ifa_flags  IFF_UP) == 0)

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Tue Dec  7 19:18:00 2010(r216266)
+++ head/sys/dev/usb/usb_pf.c   Tue Dec  7 20:23:47 2010(r216267)
@@ -64,6 +64,7 @@ usbpf_attach(struct usb_bus *ubus)
 
ifp = ubus-ifp = if_alloc(IFT_USB);
if_initname(ifp, usbus, device_get_unit(ubus-bdev));
+   ifp-if_flags = IFF_CANTCONFIG;
if_attach(ifp);
if_up(ifp);
 

Modified: head/sys/net/if.h
==
--- head/sys/net/if.h   Tue Dec  7 19:18:00 2010(r216266)
+++ head/sys/net/if.h   Tue Dec  7 20:23:47 2010(r216267)
@@ -145,7 +145,7 @@ struct if_data {
 #defineIFF_LINK2   0x4000  /* per link layer defined bit */
 #defineIFF_ALTPHYS IFF_LINK2   /* use alternate physical 
connection */
 #defineIFF_MULTICAST   0x8000  /* (i) supports multicast */
-/* 0x1 */
+#defineIFF_CANTCONFIG  0x1 /* (i) unconfigurable using 
ioctl(2) */
 #defineIFF_PPROMISC0x2 /* (n) user-requested promisc 
mode */
 #defineIFF_MONITOR 0x4 /* (n) user-requested monitor 
mode */
 #defineIFF_STATICARP   0x8 /* (n) static ARP */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r216268 - head/sys/net

2010-12-07 Thread Weongyo Jeong
Author: weongyo
Date: Tue Dec  7 20:31:04 2010
New Revision: 216268
URL: http://svn.freebsd.org/changeset/base/216268

Log:
  Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through
  ioctl(2).

Modified:
  head/sys/net/if.h

Modified: head/sys/net/if.h
==
--- head/sys/net/if.h   Tue Dec  7 20:23:47 2010(r216267)
+++ head/sys/net/if.h   Tue Dec  7 20:31:04 2010(r216268)
@@ -165,7 +165,7 @@ struct if_data {
 #defineIFF_CANTCHANGE \
(IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\
-   IFF_DYING)
+   IFF_DYING|IFF_CANTCONFIG)
 
 /*
  * Values for if_link_state.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r216091 - head/sys/dev/usb

2010-12-02 Thread Weongyo Jeong
On Wed, Dec 01, 2010 at 06:58:18PM -0500, Jung-uk Kim wrote:
 On Tuesday 30 November 2010 10:51 pm, Weongyo Jeong wrote:
  Author: weongyo
  Date: Wed Dec  1 03:51:06 2010
  New Revision: 216091
  URL: http://svn.freebsd.org/changeset/base/216091
 
  Log:
Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's
  attached or detached.  Normally it should be changed through user
  land ioctl(2) system calls but it looks there's no apps for USB and
  no need.
 
With this patch, libpcap would detect the usbus interfaces
  correctly and tcpdump(1) could dump the USB packets into PCAP
  format with -w option. However it couldn't print the output to
  console because there's no printer-routine at tcpdump(1).
 
 I have written a very hackish USB packet printer for tcpdump based on 
 Linux version.
 
 http://people.freebsd.org/~jkim/tcpdump-usb.diff

Looks good to me.

 Note we can only print headers as Linux version does.
 
 Are you planning on adopting DLT_USB_LINUX or DLT_USB_LINUX_MMAPPED or 
 applying for our own DLT, BTW?

Frankly speaking, not sure yet.  As you know, DLT_USB_LINUX and
DLT_USB_LINUX_MMAPPED types are very specific only for Linux and each
types has different structure size (48 bytes and 64 bytes).  IMHO linux
thought their own format only instead of thinking/defining a generic
format.

I think we have some cases we could select as follows:

  1) Define a generic USB packet header form and make a consensus with
 linux guys then uses DLT_USB type.
  2) Define DLT_USB_BSD and write our own code.
  3) Changes `struct usbpf_pkthdr' to be compatible with linux format
 though it's expected to have some wasted variables (e.g. time
 stamp).

regards,
Weongyo Jeong
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r216138 - head/usr.sbin/usbdump

2010-12-02 Thread Weongyo Jeong
Author: weongyo
Date: Fri Dec  3 00:44:07 2010
New Revision: 216138
URL: http://svn.freebsd.org/changeset/base/216138

Log:
  Changes the meaning of each characters '' and '' that it could be
  confused with USB OUT or USB IN packets though it just represents USB
  submit or done.  To know the USB packet direction, the endpoint address
  should be referred.
  
  Requested by: jkim

Modified:
  head/usr.sbin/usbdump/usbdump.c

Modified: head/usr.sbin/usbdump/usbdump.c
==
--- head/usr.sbin/usbdump/usbdump.c Fri Dec  3 00:05:49 2010
(r216137)
+++ head/usr.sbin/usbdump/usbdump.c Fri Dec  3 00:44:07 2010
(r216138)
@@ -247,7 +247,7 @@ print_apacket(const struct bpf_xhdr *hdr
printf( usbus%d.%d 0x%02x %s %s, up-up_busunit, up-up_address,
up-up_endpoint,
xfertype_table[up-up_xfertype],
-   up-up_type == USBPF_XFERTAP_SUBMIT ?  : );
+   up-up_type == USBPF_XFERTAP_SUBMIT ? S : D);
printf( (%d/%d), up-up_frames, up-up_length);
if (up-up_type == USBPF_XFERTAP_DONE)
printf( %s, errstr_table[up-up_error]);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r216089 - head/sbin/ifconfig

2010-11-30 Thread Weongyo Jeong
Author: weongyo
Date: Wed Dec  1 03:24:38 2010
New Revision: 216089
URL: http://svn.freebsd.org/changeset/base/216089

Log:
  Don't print usbus[0-9] interfaces that it's not the interesting
  interface type for ifconfig(8).

Modified:
  head/sbin/ifconfig/ifconfig.c

Modified: head/sbin/ifconfig/ifconfig.c
==
--- head/sbin/ifconfig/ifconfig.c   Tue Nov 30 22:39:46 2010
(r216088)
+++ head/sbin/ifconfig/ifconfig.c   Wed Dec  1 03:24:38 2010
(r216089)
@@ -295,6 +295,8 @@ main(int argc, char *argv[])
sdl = (const struct sockaddr_dl *) ifa-ifa_addr;
else
sdl = NULL;
+   if (sdl != NULL  sdl-sdl_type == IFT_USB)
+   continue;
if (cp != NULL  strcmp(cp, ifa-ifa_name) == 0  !namesonly)
continue;
iflen = strlcpy(name, ifa-ifa_name, sizeof(name));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r216091 - head/sys/dev/usb

2010-11-30 Thread Weongyo Jeong
Author: weongyo
Date: Wed Dec  1 03:51:06 2010
New Revision: 216091
URL: http://svn.freebsd.org/changeset/base/216091

Log:
  Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
  or detached.  Normally it should be changed through user land ioctl(2)
  system calls but it looks there's no apps for USB and no need.
  
  With this patch, libpcap would detect the usbus interfaces correctly and
  tcpdump(1) could dump the USB packets into PCAP format with -w option.
  However it couldn't print the output to console because there's no
  printer-routine at tcpdump(1).

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Wed Dec  1 03:35:19 2010(r216090)
+++ head/sys/dev/usb/usb_pf.c   Wed Dec  1 03:51:06 2010(r216091)
@@ -65,6 +65,7 @@ usbpf_attach(struct usb_bus *ubus)
ifp = ubus-ifp = if_alloc(IFT_USB);
if_initname(ifp, usbus, device_get_unit(ubus-bdev));
if_attach(ifp);
+   if_up(ifp);
 
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
(wrong USB pf header length (%zd), sizeof(struct usbpf_pkthdr)));
@@ -86,6 +87,7 @@ usbpf_detach(struct usb_bus *ubus)
 
if (ifp != NULL) {
bpfdetach(ifp);
+   if_down(ifp);
if_detach(ifp);
if_free(ifp);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215846 - in head/sys/dev/usb: . controller

2010-11-25 Thread Weongyo Jeong
Author: weongyo
Date: Thu Nov 25 22:56:26 2010
New Revision: 215846
URL: http://svn.freebsd.org/changeset/base/215846

Log:
  Removes a unused function `usb_bus_find'.

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_controller.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cThu Nov 25 22:19:40 
2010(r215845)
+++ head/sys/dev/usb/controller/usb_controller.cThu Nov 25 22:56:26 
2010(r215846)
@@ -602,29 +602,3 @@ usb_bus_mem_free_all(struct usb_bus *bus
mtx_destroy(bus-bus_mtx);
 }
 
-struct usb_bus *
-usb_bus_find(const char *name)
-{
-   struct usb_bus *ubus;
-   devclass_t dc;
-   device_t *devlist;
-   int devcount, error, i;
-   const char *nameunit;
-
-   dc = devclass_find(usbus);
-   if (dc == NULL)
-   return (NULL);
-   error = devclass_get_devices(dc, devlist, devcount);
-   if (error != 0)
-   return (NULL);
-   for (i = 0; i  devcount; i++) {
-   nameunit = device_get_nameunit(devlist[i]);
-   if (!strncmp(name, nameunit, strlen(nameunit))) {
-   ubus = device_get_ivars(devlist[i]);
-   free(devlist, M_TEMP);
-   return (ubus);
-   }
-   }
-   free(devlist, M_TEMP);
-   return (NULL);
-}

Modified: head/sys/dev/usb/usb_controller.h
==
--- head/sys/dev/usb/usb_controller.h   Thu Nov 25 22:19:40 2010
(r215845)
+++ head/sys/dev/usb/usb_controller.h   Thu Nov 25 22:56:26 2010
(r215846)
@@ -221,6 +221,5 @@ voidusb_bus_mem_free_all(struct usb_bus
 uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr);
 uint16_t usbd_fs_isoc_schedule_isoc_time_expand(struct usb_device *udev, 
struct usb_fs_isoc_schedule **pp_start, struct usb_fs_isoc_schedule **pp_end, 
uint16_t isoc_time);
 uint8_tusbd_fs_isoc_schedule_alloc(struct usb_fs_isoc_schedule *fss, 
uint8_t *pstart, uint16_t len);
-struct usb_bus *usb_bus_find(const char *name);
 
 #endif /* _USB_CONTROLLER_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215802 - in head/sys/dev/usb: . controller

2010-11-24 Thread Weongyo Jeong
Author: weongyo
Date: Wed Nov 24 19:11:32 2010
New Revision: 215802
URL: http://svn.freebsd.org/changeset/base/215802

Log:
  Removes all duplicated code with BPF that it's greatly simplified and
  take all benefits whenever BPF code is improved.
  
  Pointed by:   jkim
  Reviewed by:  thompsa

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_pf.c
  head/sys/dev/usb/usb_pf.h

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cWed Nov 24 18:35:11 
2010(r215801)
+++ head/sys/dev/usb/controller/usb_controller.cWed Nov 24 19:11:32 
2010(r215802)
@@ -548,7 +548,7 @@ usb_bus_mem_alloc_all(struct usb_bus *bu
 
TAILQ_INIT(bus-intr_q.head);
 
-   usbpf_attach(bus, bus-uif);
+   usbpf_attach(bus);
 
 #if USB_HAVE_BUSDMA
usb_dma_tag_setup(bus-dma_parent_tag, bus-dma_tags,

Modified: head/sys/dev/usb/usb_bus.h
==
--- head/sys/dev/usb/usb_bus.h  Wed Nov 24 18:35:11 2010(r215801)
+++ head/sys/dev/usb/usb_bus.h  Wed Nov 24 19:11:32 2010(r215802)
@@ -86,7 +86,7 @@ struct usb_bus {
struct usb_bus_methods *methods;/* filled by HC driver */
struct usb_device **devices;
 
-   struct usbpf_if *uif;   /* USB Packet Filter */
+   struct ifnet *ifp;  /* only for USB Packet Filter */
 
usb_power_mask_t hw_power_state;/* see USB_HW_POWER_XXX */
usb_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Wed Nov 24 18:35:11 2010(r215801)
+++ head/sys/dev/usb/usb_pf.c   Wed Nov 24 19:11:32 2010(r215802)
@@ -43,6 +43,8 @@ __FBSDID($FreeBSD$);
 #include sys/socket.h
 #include sys/sockio.h
 #include net/if.h
+#include net/if_types.h
+#include net/bpf.h
 
 #include dev/usb/usb.h
 #include dev/usb/usbdi.h
@@ -55,1624 +57,39 @@ __FBSDID($FreeBSD$);
 #include dev/usb/usb_pf.h
 #include dev/usb/usb_transfer.h
 
-/*
- * All usbpf implementations are extracted from bpf(9) APIs and it's
- * specialized for USB packet filtering between the driver and the host
- * controller.
- */
-
-MALLOC_DEFINE(M_USBPF, USBPktFilter, USB Packet Filter);
-
-/*
- * Rotate the packet buffers in descriptor ud.  Move the store buffer into the
- * hold slot, and the free buffer ino the store slot.  Zero the length of the
- * new store buffer.  Descriptor lock should be held.
- */
-#defineUSBPF_ROTATE_BUFFERS(ud)do {
\
-   (ud)-ud_hbuf = (ud)-ud_sbuf;  \
-   (ud)-ud_hlen = (ud)-ud_slen;  \
-   (ud)-ud_sbuf = (ud)-ud_fbuf;  \
-   (ud)-ud_slen = 0;  \
-   (ud)-ud_fbuf = NULL;   \
-   usbpf_bufheld(ud);  \
-} while (0)
-
-#ifndef __i386__
-#defineUSBPF_ALIGN
-#endif
-
-#ifndef USBPF_ALIGN
-#defineUSBPF_EXTRACT_SHORT(p)  ((u_int16_t)ntohs(*(u_int16_t *)p))
-#defineUSBPF_EXTRACT_LONG(p)   (ntohl(*(u_int32_t *)p))
-#else
-#defineUSBPF_EXTRACT_SHORT(p)  
\
-   ((u_int16_t)\
-   ((u_int16_t)*((u_char *)p+0)8|\
-   (u_int16_t)*((u_char *)p+1)0))
-#defineUSBPF_EXTRACT_LONG(p)   
\
-   ((u_int32_t)*((u_char *)p+0)24|   \
-   (u_int32_t)*((u_char *)p+1)16|\
-   (u_int32_t)*((u_char *)p+2)8| \
-   (u_int32_t)*((u_char *)p+3)0)
-#endif
-
-/*
- * Number of scratch memory words (for USBPF_LD|USBPF_MEM and USBPF_ST).
- */
-#defineUSBPF_MEMWORDS   16
-
-/* Values for ud_state */
-#defineUSBPF_IDLE  0   /* no select in progress */
-#defineUSBPF_WAITING   1   /* waiting for read timeout in 
select */
-#defineUSBPF_TIMED_OUT 2   /* read timeout has expired in 
select */
-
-#definePRIUSB  26  /* interruptible */
-
-/* Frame directions */
-enum usbpf_direction {
-   USBPF_D_IN, /* See incoming frames */
-   USBPF_D_INOUT,  /* See incoming and outgoing frames */
-   USBPF_D_OUT /* See outgoing frames */
-};
-
-static voidusbpf_append_bytes(struct usbpf_d *, caddr_t, u_int, void *,
-   u_int);
-static voidusbpf_attachd(struct usbpf_d *, struct usbpf_if *);
-static void

svn commit: r215803 - head/usr.sbin/usbdump

2010-11-24 Thread Weongyo Jeong
Author: weongyo
Date: Wed Nov 24 19:15:26 2010
New Revision: 215803
URL: http://svn.freebsd.org/changeset/base/215803

Log:
  As a refection of r215802 it should use BPF interfaces because the
  duplication code of USB pf is removed.

Modified:
  head/usr.sbin/usbdump/usbdump.c

Modified: head/usr.sbin/usbdump/usbdump.c
==
--- head/usr.sbin/usbdump/usbdump.c Wed Nov 24 19:11:32 2010
(r215802)
+++ head/usr.sbin/usbdump/usbdump.c Wed Nov 24 19:15:26 2010
(r215803)
@@ -32,8 +32,11 @@
 #include sys/param.h
 #include sys/endian.h
 #include sys/ioctl.h
+#include sys/socket.h
 #include sys/stat.h
 #include sys/utsname.h
+#include net/if.h
+#include net/bpf.h
 #include dev/usb/usb.h
 #include dev/usb/usb_pf.h
 #include dev/usb/usbdi.h
@@ -216,7 +219,7 @@ hexdump(const char *region, size_t len)
 }
 
 static void
-print_apacket(const struct usbpf_xhdr *hdr, struct usbpf_pkthdr *up,
+print_apacket(const struct bpf_xhdr *hdr, struct usbpf_pkthdr *up,
 const char *payload)
 {
struct tm *tm;
@@ -235,8 +238,8 @@ print_apacket(const struct usbpf_xhdr *h
up-up_error = le32toh(up-up_error);
up-up_interval = le32toh(up-up_interval);
 
-   tv.tv_sec = hdr-uh_tstamp.ut_sec;
-   tv.tv_usec = hdr-uh_tstamp.ut_frac;
+   tv.tv_sec = hdr-bh_tstamp.bt_sec;
+   tv.tv_usec = hdr-bh_tstamp.bt_frac;
tm = localtime(tv.tv_sec);
 
len = strftime(buf, sizeof(buf), %H:%M:%S, tm);
@@ -267,20 +270,19 @@ print_apacket(const struct usbpf_xhdr *h
print_status(up-up_status);
}
 }
-
 
 static void
 print_packets(char *data, const int datalen)
 {
struct usbpf_pkthdr *up;
-   const struct usbpf_xhdr *hdr;
+   const struct bpf_xhdr *hdr;
u_int32_t framelen, x;
char *ptr, *next;
 
for (ptr = data; ptr  (data + datalen); ptr = next) {
-   hdr = (const struct usbpf_xhdr *)ptr;
-   up = (struct usbpf_pkthdr *)(ptr + hdr-uh_hdrlen);
-   next = ptr + USBPF_WORDALIGN(hdr-uh_hdrlen + hdr-uh_caplen);
+   hdr = (const struct bpf_xhdr *)ptr;
+   up = (struct usbpf_pkthdr *)(ptr + hdr-bh_hdrlen);
+   next = ptr + BPF_WORDALIGN(hdr-bh_hdrlen + hdr-bh_caplen);
 
ptr = ((char *)up) + sizeof(struct usbpf_pkthdr);
if (w_arg == NULL)
@@ -404,12 +406,12 @@ int
 main(int argc, char *argv[])
 {
struct timeval tv;
-   struct usbpf_insn total_insn;
-   struct usbpf_program total_prog;
-   struct usbpf_stat us;
-   struct usbpf_version uv;
+   struct bpf_insn total_insn;
+   struct bpf_program total_prog;
+   struct bpf_stat us;
+   struct bpf_version bv;
struct usbcap uc, *p = uc;
-   struct usbpf_ifreq ufr;
+   struct ifreq ifr;
long snapshot = 192;
u_int v;
int fd, o;
@@ -454,37 +456,37 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
 
-   p-fd = fd = open(/dev/usbpf, O_RDONLY);
+   p-fd = fd = open(/dev/bpf, O_RDONLY);
if (p-fd  0) {
fprintf(stderr, (no devices found)\n);
return (EXIT_FAILURE);
}
 
-   if (ioctl(fd, UIOCVERSION, (caddr_t)uv)  0) {
-   fprintf(stderr, UIOCVERSION: %s\n, strerror(errno));
+   if (ioctl(fd, BIOCVERSION, (caddr_t)bv)  0) {
+   fprintf(stderr, BIOCVERSION: %s\n, strerror(errno));
return (EXIT_FAILURE);
}
-   if (uv.uv_major != USBPF_MAJOR_VERSION ||
-   uv.uv_minor  USBPF_MINOR_VERSION) {
+   if (bv.bv_major != BPF_MAJOR_VERSION ||
+   bv.bv_minor  BPF_MINOR_VERSION) {
fprintf(stderr, kernel bpf filter out of date);
return (EXIT_FAILURE);
}
 
-   if ((ioctl(fd, UIOCGBLEN, (caddr_t)v)  0) || v  65536)
-   v = 65536;
+   if ((ioctl(fd, BIOCGBLEN, (caddr_t)v)  0) || v  4096)
+   v = 4096;
for ( ; v != 0; v = 1) {
-   (void)ioctl(fd, UIOCSBLEN, (caddr_t)v);
-   (void)strncpy(ufr.ufr_name, i_arg, sizeof(ufr.ufr_name));
-   if (ioctl(fd, UIOCSETIF, (caddr_t)ufr) = 0)
+   (void)ioctl(fd, BIOCSBLEN, (caddr_t)v);
+   (void)strncpy(ifr.ifr_name, i_arg, sizeof(ifr.ifr_name));
+   if (ioctl(fd, BIOCSETIF, (caddr_t)ifr) = 0)
break;
}
if (v == 0) {
-   fprintf(stderr, UIOCSBLEN: %s: No buffer size worked, i_arg);
+   fprintf(stderr, BIOCSBLEN: %s: No buffer size worked, i_arg);
return (EXIT_FAILURE);
}
 
-   if (ioctl(fd, UIOCGBLEN, (caddr_t)v)  0) {
-   fprintf(stderr, UIOCGBLEN: %s, strerror(errno));
+   if (ioctl(fd, BIOCGBLEN, (caddr_t)v)  0) {
+   fprintf(stderr, BIOCGBLEN: %s, strerror(errno));

svn commit: r215804 - head/sys/dev/usb

2010-11-24 Thread Weongyo Jeong
Author: weongyo
Date: Wed Nov 24 21:43:36 2010
New Revision: 215804
URL: http://svn.freebsd.org/changeset/base/215804

Log:
  Fixes a compiler warning when it's compiled with INVARIANTS.
  
  Pointy hat to:me

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Wed Nov 24 19:15:26 2010(r215803)
+++ head/sys/dev/usb/usb_pf.c   Wed Nov 24 21:43:36 2010(r215804)
@@ -67,7 +67,7 @@ usbpf_attach(struct usb_bus *ubus)
if_attach(ifp);
 
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
-   (wrong USB pf header length (%d), sizeof(struct usbpf_pkthdr)));
+   (wrong USB pf header length (%zd), sizeof(struct usbpf_pkthdr)));
 
/*
 * XXX According to the specification of DLT_USB, it indicates packets
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215810 - head/sys/dev/usb

2010-11-24 Thread Weongyo Jeong
Author: weongyo
Date: Thu Nov 25 03:02:53 2010
New Revision: 215810
URL: http://svn.freebsd.org/changeset/base/215810

Log:
  Assigning the unit number for each interfaces could not use ubus-parent
  because it could differ depending on the host controller type.  It could
  lead the duplicate unit number assignment.

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Wed Nov 24 22:44:10 2010(r215809)
+++ head/sys/dev/usb/usb_pf.c   Thu Nov 25 03:02:53 2010(r215810)
@@ -61,9 +61,10 @@ void
 usbpf_attach(struct usb_bus *ubus)
 {
struct ifnet *ifp;
+   devclass_t dc = devclass_find(usbus);
 
ifp = ubus-ifp = if_alloc(IFT_USB);
-   if_initname(ifp, usbus, device_get_unit(ubus-parent));
+   if_initname(ifp, usbus, devclass_get_count(dc));
if_attach(ifp);
 
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215812 - in head/sys/dev/usb: . controller

2010-11-24 Thread Weongyo Jeong
Author: weongyo
Date: Thu Nov 25 03:30:43 2010
New Revision: 215812
URL: http://svn.freebsd.org/changeset/base/215812

Log:
  Handles the unit number correctly that the previous commit had a problem
  (wrong unit number for a host controller) when the module is load /
  unloaded repeatly.  Attaching the USB pf is moved to usbus device's
  attach.
  
  Pointed by:   yongari

Modified:
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cThu Nov 25 03:16:31 
2010(r215811)
+++ head/sys/dev/usb/controller/usb_controller.cThu Nov 25 03:30:43 
2010(r215812)
@@ -207,6 +207,8 @@ usb_detach(device_t dev)
 
usb_proc_free(bus-control_xfer_proc);
 
+   usbpf_detach(bus);
+
return (0);
 }
 
@@ -435,6 +437,8 @@ usb_attach_sub(device_t dev, struct usb_
usb_devclass_ptr = devclass_find(usbus);
mtx_unlock(Giant);
 
+   usbpf_attach(bus);
+
/* Initialise USB process messages */
bus-explore_msg[0].hdr.pm_callback = usb_bus_explore;
bus-explore_msg[0].bus = bus;
@@ -548,8 +552,6 @@ usb_bus_mem_alloc_all(struct usb_bus *bu
 
TAILQ_INIT(bus-intr_q.head);
 
-   usbpf_attach(bus);
-
 #if USB_HAVE_BUSDMA
usb_dma_tag_setup(bus-dma_parent_tag, bus-dma_tags,
dmat, bus-bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
@@ -597,8 +599,6 @@ usb_bus_mem_free_all(struct usb_bus *bus
usb_dma_tag_unsetup(bus-dma_parent_tag);
 #endif
 
-   usbpf_detach(bus);
-
mtx_destroy(bus-bus_mtx);
 }
 

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Thu Nov 25 03:16:31 2010(r215811)
+++ head/sys/dev/usb/usb_pf.c   Thu Nov 25 03:30:43 2010(r215812)
@@ -61,10 +61,9 @@ void
 usbpf_attach(struct usb_bus *ubus)
 {
struct ifnet *ifp;
-   devclass_t dc = devclass_find(usbus);
 
ifp = ubus-ifp = if_alloc(IFT_USB);
-   if_initname(ifp, usbus, devclass_get_count(dc));
+   if_initname(ifp, usbus, device_get_unit(ubus-bdev));
if_attach(ifp);
 
KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215764 - head/sys/dev/usb

2010-11-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Nov 23 20:23:25 2010
New Revision: 215764
URL: http://svn.freebsd.org/changeset/base/215764

Log:
  Fixes a kernel crash when usb module is reloaded after unload that it
  didn't destroy the cdev properly.
  
  Pointy hat to:me
  Reported by:  Brandon Gooch jamesbrandongooch at gmail dot com, jkim

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Tue Nov 23 19:23:47 2010(r215763)
+++ head/sys/dev/usb/usb_pf.c   Tue Nov 23 20:23:25 2010(r215764)
@@ -141,6 +141,7 @@ static struct cdevsw usbpf_cdevsw = {
.d_kqfilter =   usbpf_kqfilter,
 };
 
+static struct cdev *usbpf_cdev;
 static LIST_HEAD(, usbpf_if)   usbpf_iflist;
 static struct mtx  usbpf_mtx;  /* global lock */
 static int usbpf_uifd_cnt;
@@ -1850,13 +1851,26 @@ usbpf_append_bytes(struct usbpf_d *ud, c
 static void
 usbpf_drvinit(void *unused)
 {
-   struct cdev *dev;
 
mtx_init(usbpf_mtx, USB packet filter global lock, NULL,
MTX_DEF);
LIST_INIT(usbpf_iflist);
 
-   dev = make_dev(usbpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, usbpf);
+   usbpf_cdev = make_dev(usbpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
+   usbpf);
+}
+
+static void
+usbpf_drvuninit(void)
+{
+
+   if (usbpf_cdev != NULL) {
+   destroy_dev(usbpf_cdev);
+   usbpf_cdev = NULL;
+   }
+   mtx_destroy(usbpf_mtx);
 }
 
 SYSINIT(usbpf_dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, usbpf_drvinit, NULL);
+SYSUNINIT(usbpf_undev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, usbpf_drvuninit, NULL);
+
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r215649 - in head/sys: conf dev/usb dev/usb/controller modules/usb/usb

2010-11-21 Thread Weongyo Jeong
Author: weongyo
Date: Mon Nov 22 01:11:28 2010
New Revision: 215649
URL: http://svn.freebsd.org/changeset/base/215649

Log:
  Adds a USB packet filter feature to the stack that it could capture
  packets which go through each USB host controllers.  Its implementations
  are almost based on BPF code and very similar with it except it's
  little bit customized for USB packet only.  The userland program
  usbdump(8) would be committed soon.
  
  Discussed with:   hps, thompsa, yongari

Added:
  head/sys/dev/usb/usb_pf.c   (contents, props changed)
  head/sys/dev/usb/usb_pf.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/usb_bus.h
  head/sys/dev/usb/usb_controller.h
  head/sys/dev/usb/usb_transfer.c
  head/sys/modules/usb/usb/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Nov 22 00:44:43 2010(r215648)
+++ head/sys/conf/files Mon Nov 22 01:11:28 2010(r215649)
@@ -1779,6 +1779,7 @@ dev/usb/usb_lookup.c  optional usb
 dev/usb/usb_mbuf.c optional usb
 dev/usb/usb_msctest.c  optional usb
 dev/usb/usb_parse.coptional usb
+dev/usb/usb_pf.c   optional usb
 dev/usb/usb_process.c  optional usb
 dev/usb/usb_request.c  optional usb
 dev/usb/usb_transfer.c optional usb

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cMon Nov 22 00:44:43 
2010(r215648)
+++ head/sys/dev/usb/controller/usb_controller.cMon Nov 22 01:11:28 
2010(r215649)
@@ -61,6 +61,7 @@
 
 #include dev/usb/usb_controller.h
 #include dev/usb/usb_bus.h
+#include dev/usb/usb_pf.h
 
 /* function prototypes  */
 
@@ -547,6 +548,8 @@ usb_bus_mem_alloc_all(struct usb_bus *bu
 
TAILQ_INIT(bus-intr_q.head);
 
+   usbpf_attach(bus, bus-uif);
+
 #if USB_HAVE_BUSDMA
usb_dma_tag_setup(bus-dma_parent_tag, bus-dma_tags,
dmat, bus-bus_mtx, NULL, 32, USB_BUS_DMA_TAG_MAX);
@@ -594,5 +597,34 @@ usb_bus_mem_free_all(struct usb_bus *bus
usb_dma_tag_unsetup(bus-dma_parent_tag);
 #endif
 
+   usbpf_detach(bus);
+
mtx_destroy(bus-bus_mtx);
 }
+
+struct usb_bus *
+usb_bus_find(const char *name)
+{
+   struct usb_bus *ubus;
+   devclass_t dc;
+   device_t *devlist;
+   int devcount, error, i;
+   const char *nameunit;
+
+   dc = devclass_find(usbus);
+   if (dc == NULL)
+   return (NULL);
+   error = devclass_get_devices(dc, devlist, devcount);
+   if (error != 0)
+   return (NULL);
+   for (i = 0; i  devcount; i++) {
+   nameunit = device_get_nameunit(devlist[i]);
+   if (!strncmp(name, nameunit, strlen(nameunit))) {
+   ubus = device_get_ivars(devlist[i]);
+   free(devlist, M_TEMP);
+   return (ubus);
+   }
+   }
+   free(devlist, M_TEMP);
+   return (NULL);
+}

Modified: head/sys/dev/usb/usb_bus.h
==
--- head/sys/dev/usb/usb_bus.h  Mon Nov 22 00:44:43 2010(r215648)
+++ head/sys/dev/usb/usb_bus.h  Mon Nov 22 01:11:28 2010(r215649)
@@ -86,6 +86,8 @@ struct usb_bus {
struct usb_bus_methods *methods;/* filled by HC driver */
struct usb_device **devices;
 
+   struct usbpf_if *uif;   /* USB Packet Filter */
+
usb_power_mask_t hw_power_state;/* see USB_HW_POWER_XXX */
usb_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
 

Modified: head/sys/dev/usb/usb_controller.h
==
--- head/sys/dev/usb/usb_controller.h   Mon Nov 22 00:44:43 2010
(r215648)
+++ head/sys/dev/usb/usb_controller.h   Mon Nov 22 01:11:28 2010
(r215649)
@@ -221,5 +221,6 @@ voidusb_bus_mem_free_all(struct usb_bus
 uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr);
 uint16_t usbd_fs_isoc_schedule_isoc_time_expand(struct usb_device *udev, 
struct usb_fs_isoc_schedule **pp_start, struct usb_fs_isoc_schedule **pp_end, 
uint16_t isoc_time);
 uint8_tusbd_fs_isoc_schedule_alloc(struct usb_fs_isoc_schedule *fss, 
uint8_t *pstart, uint16_t len);
+struct usb_bus *usb_bus_find(const char *name);
 
 #endif /* _USB_CONTROLLER_H_ */

Added: head/sys/dev/usb/usb_pf.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/usb/usb_pf.c   Mon Nov 22 01:11:28 2010(r215649)
@@ -0,0 +1,1862 @@
+/*-
+ * Copyright (c) 1990, 1991, 1993
+ * The Regents of the University 

svn commit: r215651 - head/usr.sbin/usbdump

2010-11-21 Thread Weongyo Jeong
Author: weongyo
Date: Mon Nov 22 01:28:29 2010
New Revision: 215651
URL: http://svn.freebsd.org/changeset/base/215651

Log:
  Adds usbdump(8) tool that currently it only supports the very basic
  feature set.  It's not connected to the build yet.
  
  Reviewed by:  hps

Added:
  head/usr.sbin/usbdump/
  head/usr.sbin/usbdump/Makefile   (contents, props changed)
  head/usr.sbin/usbdump/usbdump.8   (contents, props changed)
  head/usr.sbin/usbdump/usbdump.c   (contents, props changed)

Added: head/usr.sbin/usbdump/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/usbdump/Makefile  Mon Nov 22 01:28:29 2010
(r215651)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+PROG=  usbdump
+SRCS=  usbdump.c
+MAN=   usbdump.8
+WARNS?=4
+
+.include bsd.prog.mk

Added: head/usr.sbin/usbdump/usbdump.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/usbdump/usbdump.8 Mon Nov 22 01:28:29 2010
(r215651)
@@ -0,0 +1,77 @@
+.\
+.\ Copyright (c) 2010 Weongyo Jeong.
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd October 14, 2010
+.Dt usbdump 8
+.Os
+.Sh NAME
+.Nm usbdump
+.Nd dump traffic on USB host controller
+.Sh SYNOPSIS
+.Nm
+.Op Fl i Ar ifname
+.Op Fl r Ar file
+.Op Fl s Ar snaplen
+.Op Fl v
+.Op Fl w Ar file
+.Sh DESCRIPTION
+The
+.Nm
+utility provides a way to dump USB packets on each host controller.
+.Pp
+The following options are accepted.
+.Bl -tag -width .Fl f Ar file
+.It Fl i Ar ifname
+Listen on USB bus interface.
+.It Fl r Ar file
+Read the raw packets from file.
+.It Fl s Ar snaplen
+Snapshot bytes from each packet.
+.It Fl v
+Enable debugging messages.
+When it defined multiple times the verbose level increases.
+.It Fl w Ar file
+Write the raw packets to file.
+.El
+.Sh EXAMPLES
+Captures the USB raw packets alive on usbus2:
+.Pp
+.Dl usbdump -i usbus2 -s 256 -v
+.Pp
+Dumps the USB raw packets of usbus2 into the file without packet
+size limit:
+.Pp
+.Dl usbdump -i usbus2 -s 0 -w /tmp/dump_pkts
+.Pp
+Read the USB raw packets from the file:
+.Pp
+.Dl usbdump -r /tmp/dump_pkts -v
+.Sh SEE ALSO
+.Xr usbconfig 8
+.Sh AUTHORS
+.An Weongyo Jeong
+.Aq weon...@freebsd.org .

Added: head/usr.sbin/usbdump/usbdump.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/usbdump/usbdump.c Mon Nov 22 01:28:29 2010
(r215651)
@@ -0,0 +1,542 @@
+/*-
+ * Copyright (c) 2010 Weongyo Jeong weon...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the NO WARRANTY disclaimer below (Disclaimer) and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT

svn commit: r212625 - head/share/man/man4

2010-09-14 Thread Weongyo Jeong
Author: weongyo
Date: Tue Sep 14 23:27:06 2010
New Revision: 212625
URL: http://svn.freebsd.org/changeset/base/212625

Log:
  Fixes spellings and uses the better sentence.  While I'm here bumps
  date.
  
  Pointed by:   imp, Ruslan Mahmatkhanov cvs-src at yandex dot ru

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Tue Sep 14 21:40:29 2010(r212624)
+++ head/share/man/man4/bwn.4   Tue Sep 14 23:27:06 2010(r212625)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 11, 2010
+.Dd September 14, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -93,12 +93,11 @@ driver supports Broadcom BCM43xx based w
 .It US Robotics 5411  BCM4318 CardBus b/g
 .El
 .Pp
-However if the device chipset is one of BCM4301, BCM4303 and BCM4306 rev 2,
-uses
+Users of older Broadcom chipsets (BCM4301, BCM4303 and BCM4306 rev 2)
+must use
 .Xr bwi 4
-instead of
-.Xr bwn 4
-because the vendor dropped the firmware support.
+because the v4 version of the firmware does not support these chips.
+The newer firmware is too big to fit into these old chips.
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):
 .Pp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212480 - head/share/man/man4

2010-09-11 Thread Weongyo Jeong
Author: weongyo
Date: Sat Sep 11 21:49:28 2010
New Revision: 212480
URL: http://svn.freebsd.org/changeset/base/212480

Log:
  Mentions cases when bwi(4) driver should be used that it only wrote
  about chipset type instead of card names because it's not easy to sort
  names what cards use these chipsets.
  
  Pointed by:   imp

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Sat Sep 11 20:18:15 2010(r212479)
+++ head/share/man/man4/bwn.4   Sat Sep 11 21:49:28 2010(r212480)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 6, 2010
+.Dd September 11, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -92,6 +92,13 @@ driver supports Broadcom BCM43xx based w
 .It TRENDnet TEW-401PCplusBCM4306 CardBus b/g
 .It US Robotics 5411  BCM4318 CardBus b/g
 .El
+.Pp
+However if the device chipset is one of BCM4301, BCM4303 and BCM4306 rev 2,
+uses
+.Xr bwi 4
+instead of
+.Xr bwn 4
+because the vendor dropped the firmware support.
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):
 .Pp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212270 - head/share/man/man4

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:02:08 2010
New Revision: 212270
URL: http://svn.freebsd.org/changeset/base/212270

Log:
  Adds bwi(4) at SEE ALSO section because some old devices aren't
  supported by the bwn(4) firmware that as fas as I know the vendor
  dropped its support.  Bumps date also.

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Mon Sep  6 21:39:54 2010(r212269)
+++ head/share/man/man4/bwn.4   Mon Sep  6 22:02:08 2010(r212270)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 25, 2010
+.Dd September 6, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -112,6 +112,7 @@ ifconfig wlan create wlandev bwn0 ssid m
 .Ed
 .Sh SEE ALSO
 .Xr arp 4 ,
+.Xr bwi 4 ,
 .Xr cardbus 4 ,
 .Xr intro 4 ,
 .Xr pci 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212271 - head/share/man/man4

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:10:57 2010
New Revision: 212271
URL: http://svn.freebsd.org/changeset/base/212271

Log:
  Adds a CAVEATS section to mention DMA issues that currently only
  a solution is using PIO mode.  As fas as I know all open source based
  broadcom drivers for specially LP PHY has this issue because it's
  a reverse engineered driver from wl(4).
  
  Pointed by:   Warren Block wblock at wonkity.com

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Mon Sep  6 22:02:08 2010(r212270)
+++ head/share/man/man4/bwn.4   Mon Sep  6 22:10:57 2010(r212271)
@@ -125,6 +125,9 @@ The
 .Nm
 driver first appeared in
 .Fx 8.1 .
+.Sh CAVEATS
+Some LP PHY devices have DMA operation problems that in that case try to
+use PIO mode.
 .Sh AUTHORS
 .An -nosplit
 The
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212272 - head/share/man/man4

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:23:35 2010
New Revision: 212272
URL: http://svn.freebsd.org/changeset/base/212272

Log:
  Adds LOADER TUNABLES section to mention knobs which could be controlled
  by loader(8) interface.

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Mon Sep  6 22:10:57 2010(r212271)
+++ head/share/man/man4/bwn.4   Mon Sep  6 22:23:35 2010(r212272)
@@ -110,6 +110,20 @@ Join a specific BSS network with 64-bit 
 ifconfig wlan create wlandev bwn0 ssid my_net \e
 wepmode on wepkey 0x1234567890 weptxkey 1 up
 .Ed
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.bwn.msi_disable
+This tunable disables MSI support on the hardware.
+The default value is 0.
+.It Va hw.bwn.usedma
+This tunable enables DMA operations on the hardware.
+If the value is 0, PIO mode would be used.
+The default value is 1.
+.El
 .Sh SEE ALSO
 .Xr arp 4 ,
 .Xr bwi 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212273 - stable/8/sys/dev/bwn

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:28:46 2010
New Revision: 212273
URL: http://svn.freebsd.org/changeset/base/212273

Log:
  MFC r210393:
Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is
used even if it's unreachable.
  
PR: kern/144505
Submitted by:   Henning Petersen henning.petersen at t-online dot de

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Mon Sep  6 22:23:35 2010
(r212272)
+++ stable/8/sys/dev/bwn/if_bwn.c   Mon Sep  6 22:28:46 2010
(r212273)
@@ -12828,9 +12828,9 @@ bwn_phy_lp_calc_rx_iq_comp(struct bwn_ma
int _t; \
_t = _x - 11;   \
if (_t = 0)\
-   tmp[3] = (_y  (31 - _x)) / (_z  _t);\
+   _v = (_y  (31 - _x)) / (_z  _t);\
else\
-   tmp[3] = (_y  (31 - _x)) / (_z  -_t);   \
+   _v = (_y  (31 - _x)) / (_z  -_t);   \
 } while (0)
struct bwn_phy_lp_iq_est ie;
uint16_t v0, v1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212274 - stable/8/sys/dev/bwn

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:31:24 2010
New Revision: 212274
URL: http://svn.freebsd.org/changeset/base/212274

Log:
  MFC r209888:
Fixes a bug for LP PHY that some frames have 2 padding bytes at the
start so we should adjust the mbuf if the driver is running in PIO
mode.  Now it should work well with WPA authentication and association
for LP PHY devices.
  
Tested by:Warren Block wblock at wonkity.com

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Mon Sep  6 22:28:46 2010
(r212273)
+++ stable/8/sys/dev/bwn/if_bwn.c   Mon Sep  6 22:31:24 2010
(r212274)
@@ -9073,7 +9073,7 @@ bwn_pio_rxeof(struct bwn_pio_rxqueue *pr
struct mbuf *m;
uint32_t ctl32, macstat, v32;
unsigned int i, padding;
-   uint16_t ctl16, len, v16;
+   uint16_t ctl16, len, totlen, v16;
unsigned char *mp;
char *data;
 
@@ -9132,7 +9132,8 @@ ready:
}
 
padding = (macstat  BWN_RX_MAC_PADDING) ? 2 : 0;
-   KASSERT(len + padding = MCLBYTES, (too big..\n));
+   totlen = len + padding;
+   KASSERT(totlen = MCLBYTES, (too big..\n));
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) {
device_printf(sc-sc_dev, %s: out of memory, __func__);
@@ -9140,12 +9141,12 @@ ready:
}
mp = mtod(m, unsigned char *);
if (prq-prq_rev = 8) {
-   siba_read_multi_4(sc-sc_dev, mp + padding, (len  ~3),
+   siba_read_multi_4(sc-sc_dev, mp, (totlen  ~3),
prq-prq_base + BWN_PIO8_RXDATA);
-   if (len  3) {
+   if (totlen  3) {
v32 = bwn_pio_rx_read_4(prq, BWN_PIO8_RXDATA);
-   data = (mp[len + padding - 1]);
-   switch (len  3) {
+   data = (mp[totlen - 1]);
+   switch (totlen  3) {
case 3:
*data = (v32  16);
data--;
@@ -9157,16 +9158,16 @@ ready:
}
}
} else {
-   siba_read_multi_2(sc-sc_dev, mp + padding, (len  ~1),
+   siba_read_multi_2(sc-sc_dev, mp, (totlen  ~1),
prq-prq_base + BWN_PIO_RXDATA);
-   if (len  1) {
+   if (totlen  1) {
v16 = bwn_pio_rx_read_2(prq, BWN_PIO_RXDATA);
-   mp[len + padding - 1] = v16;
+   mp[totlen - 1] = v16;
}
}
 
m-m_pkthdr.rcvif = ifp;
-   m-m_len = m-m_pkthdr.len = len + padding;
+   m-m_len = m-m_pkthdr.len = totlen;
 
bwn_rxeof(prq-prq_mac, m, rxhdr);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r212275 - in stable/8/sys: conf modules

2010-09-06 Thread Weongyo Jeong
Author: weongyo
Date: Mon Sep  6 22:47:52 2010
New Revision: 212275
URL: http://svn.freebsd.org/changeset/base/212275

Log:
  MFC r196636:
Connect bwi up to the build.  While there are some problems with this
driver still, it generally works well for most people most of the
time.  It is still too green for GENERIC, however.
  
Submitted by:   many (latest being kwm@)
  Approved by:  imp
  Requested by: Warren Block wblock at wonkity dot com

Modified:
  stable/8/sys/conf/NOTES
  stable/8/sys/modules/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/conf/NOTES
==
--- stable/8/sys/conf/NOTES Mon Sep  6 22:31:24 2010(r212274)
+++ stable/8/sys/conf/NOTES Mon Sep  6 22:47:52 2010(r212275)
@@ -1845,6 +1845,7 @@ devicemiibus
 #  BCM570x family of controllers, including the 3Com 3c996-T,
 #  the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and
 #  the embedded gigE NICs on Dell PowerEdge 2550 servers.
+# bwi: Broadcom BCM430* and BCM431* family of wireless adapters.
 # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn
 # cm:  Arcnet SMC COM90c26 / SMC COM90c56
 #  (and SMC COM90c66 in '56 compatibility mode) adapters.
@@ -2016,6 +2017,7 @@ devicewb  # Winbond W89C840F
 device xl  # 3Com 3c90x (``Boomerang'', ``Cyclone'')
 
 # PCI Ethernet NICs.
+device bwi # Broadcom BCM430* BCM431*
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
 device igb # Intel Pro/1000 PCIE Gigabit Ethernet

Modified: stable/8/sys/modules/Makefile
==
--- stable/8/sys/modules/Makefile   Mon Sep  6 22:31:24 2010
(r212274)
+++ stable/8/sys/modules/Makefile   Mon Sep  6 22:47:52 2010
(r212275)
@@ -42,6 +42,7 @@ SUBDIR=   ${_3dfx} \
${_bktr} \
${_bm} \
bridgestp \
+   bwi \
bwn \
cam \
${_canbepm} \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r210391 - stable/8/sys/dev/bwi

2010-07-22 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul 22 19:22:32 2010
New Revision: 210391
URL: http://svn.freebsd.org/changeset/base/210391

Log:
  MFC r209892:
Fixes a page fault in bwi_pci_probe() because the array isn't
terminated with NULL.
  
PR:   kern/148473
Submitted by: Grzegorz Dabrowski grzegorz.dabrowski at gmail dot com

Modified:
  stable/8/sys/dev/bwi/if_bwi_pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bwi/if_bwi_pci.c
==
--- stable/8/sys/dev/bwi/if_bwi_pci.c   Thu Jul 22 19:15:26 2010
(r210390)
+++ stable/8/sys/dev/bwi/if_bwi_pci.c   Thu Jul 22 19:22:32 2010
(r210391)
@@ -91,7 +91,8 @@ static const struct bwi_dev {
{ PCI_VENDOR_BROADCOM, 0x4324,Broadcom BCM4309 802.11a/b/g Wireless 
Lan },
{ PCI_VENDOR_BROADCOM, 0x4318,Broadcom BCM4318 802.11b/g Wireless Lan 
},
{ PCI_VENDOR_BROADCOM, 0x4319,Broadcom BCM4318 802.11a/b/g Wireless 
Lan },
-   { PCI_VENDOR_BROADCOM, 0x431a,Broadcom BCM4318 802.11a Wireless Lan }
+   { PCI_VENDOR_BROADCOM, 0x431a,Broadcom BCM4318 802.11a Wireless Lan },
+   { 0, 0, NULL }
 };
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r210393 - head/sys/dev/bwn

2010-07-22 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul 22 20:08:02 2010
New Revision: 210393
URL: http://svn.freebsd.org/changeset/base/210393

Log:
  Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is
  used even if it's unreachable.
  
  PR:   kern/144505
  Submitted by: Henning Petersen henning.petersen at t-online dot de
  MFC after:1 week

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Thu Jul 22 19:30:13 2010(r210392)
+++ head/sys/dev/bwn/if_bwn.c   Thu Jul 22 20:08:02 2010(r210393)
@@ -12828,9 +12828,9 @@ bwn_phy_lp_calc_rx_iq_comp(struct bwn_ma
int _t; \
_t = _x - 11;   \
if (_t = 0)\
-   tmp[3] = (_y  (31 - _x)) / (_z  _t);\
+   _v = (_y  (31 - _x)) / (_z  _t);\
else\
-   tmp[3] = (_y  (31 - _x)) / (_z  -_t);   \
+   _v = (_y  (31 - _x)) / (_z  -_t);   \
 } while (0)
struct bwn_phy_lp_iq_est ie;
uint16_t v0, v1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209888 - head/sys/dev/bwn

2010-07-10 Thread Weongyo Jeong
Author: weongyo
Date: Sat Jul 10 21:39:03 2010
New Revision: 209888
URL: http://svn.freebsd.org/changeset/base/209888

Log:
  Fixes a bug for LP PHY that some frames have 2 padding bytes at the
  start so we should adjust the mbuf if the driver is running in PIO mode.
  Now it should work well with WPA authentication and association for LP
  PHY devices.
  
  Tested by:Warren Block wblock at wonkity.com
  MFC after:1 month

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat Jul 10 18:22:44 2010(r209887)
+++ head/sys/dev/bwn/if_bwn.c   Sat Jul 10 21:39:03 2010(r209888)
@@ -9072,7 +9072,7 @@ bwn_pio_rxeof(struct bwn_pio_rxqueue *pr
struct mbuf *m;
uint32_t ctl32, macstat, v32;
unsigned int i, padding;
-   uint16_t ctl16, len, v16;
+   uint16_t ctl16, len, totlen, v16;
unsigned char *mp;
char *data;
 
@@ -9131,7 +9131,8 @@ ready:
}
 
padding = (macstat  BWN_RX_MAC_PADDING) ? 2 : 0;
-   KASSERT(len + padding = MCLBYTES, (too big..\n));
+   totlen = len + padding;
+   KASSERT(totlen = MCLBYTES, (too big..\n));
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) {
device_printf(sc-sc_dev, %s: out of memory, __func__);
@@ -9139,12 +9140,12 @@ ready:
}
mp = mtod(m, unsigned char *);
if (prq-prq_rev = 8) {
-   siba_read_multi_4(sc-sc_dev, mp + padding, (len  ~3),
+   siba_read_multi_4(sc-sc_dev, mp, (totlen  ~3),
prq-prq_base + BWN_PIO8_RXDATA);
-   if (len  3) {
+   if (totlen  3) {
v32 = bwn_pio_rx_read_4(prq, BWN_PIO8_RXDATA);
-   data = (mp[len + padding - 1]);
-   switch (len  3) {
+   data = (mp[totlen - 1]);
+   switch (totlen  3) {
case 3:
*data = (v32  16);
data--;
@@ -9156,16 +9157,16 @@ ready:
}
}
} else {
-   siba_read_multi_2(sc-sc_dev, mp + padding, (len  ~1),
+   siba_read_multi_2(sc-sc_dev, mp, (totlen  ~1),
prq-prq_base + BWN_PIO_RXDATA);
-   if (len  1) {
+   if (totlen  1) {
v16 = bwn_pio_rx_read_2(prq, BWN_PIO_RXDATA);
-   mp[len + padding - 1] = v16;
+   mp[totlen - 1] = v16;
}
}
 
m-m_pkthdr.rcvif = ifp;
-   m-m_len = m-m_pkthdr.len = len + padding;
+   m-m_len = m-m_pkthdr.len = totlen;
 
bwn_rxeof(prq-prq_mac, m, rxhdr);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209892 - head/sys/dev/bwi

2010-07-10 Thread Weongyo Jeong
Author: weongyo
Date: Sat Jul 10 22:37:23 2010
New Revision: 209892
URL: http://svn.freebsd.org/changeset/base/209892

Log:
  Fixes a page fault in bwi_pci_probe() because the array isn't terminated
  with NULL.
  
  PR:   kern/148473
  Submitted by: Grzegorz Dabrowski grzegorz.dabrowski at gmail dot com
  MFC after:1 week

Modified:
  head/sys/dev/bwi/if_bwi_pci.c

Modified: head/sys/dev/bwi/if_bwi_pci.c
==
--- head/sys/dev/bwi/if_bwi_pci.c   Sat Jul 10 22:29:05 2010
(r209891)
+++ head/sys/dev/bwi/if_bwi_pci.c   Sat Jul 10 22:37:23 2010
(r209892)
@@ -91,7 +91,8 @@ static const struct bwi_dev {
{ PCI_VENDOR_BROADCOM, 0x4324,Broadcom BCM4309 802.11a/b/g Wireless 
Lan },
{ PCI_VENDOR_BROADCOM, 0x4318,Broadcom BCM4318 802.11b/g Wireless Lan 
},
{ PCI_VENDOR_BROADCOM, 0x4319,Broadcom BCM4318 802.11a/b/g Wireless 
Lan },
-   { PCI_VENDOR_BROADCOM, 0x431a,Broadcom BCM4318 802.11a Wireless Lan }
+   { PCI_VENDOR_BROADCOM, 0x431a,Broadcom BCM4318 802.11a Wireless Lan },
+   { 0, 0, NULL }
 };
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209821 - stable/8/sys/dev/bwi

2010-07-08 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul  8 19:36:38 2010
New Revision: 209821
URL: http://svn.freebsd.org/changeset/base/209821

Log:
  MFC r209597:
Fixes NULL pointer reference that it's occurred when the state is
changed to RUN because ic-ic_newassoc isn't set anywhere now.  In the
previous bwi_newassoc() is used to initialize AMRR rate routines.
  
Tested by:Warren Block wblock at wonkity.com

Modified:
  stable/8/sys/dev/bwi/if_bwi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bwi/if_bwi.c
==
--- stable/8/sys/dev/bwi/if_bwi.c   Thu Jul  8 19:22:52 2010
(r209820)
+++ stable/8/sys/dev/bwi/if_bwi.c   Thu Jul  8 19:36:38 2010
(r209821)
@@ -1769,7 +1769,6 @@ bwi_newstate(struct ieee80211vap *vap, e
enum ieee80211_state ostate = vap-iv_state;
struct bwi_softc *sc = ifp-if_softc;
struct bwi_mac *mac;
-   struct ieee80211_node *ni = vap-iv_bss;
int error;
 
BWI_LOCK(sc);
@@ -1817,10 +1816,6 @@ bwi_newstate(struct ieee80211vap *vap, e
 #else
sc-sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
-   if (vap-iv_opmode == IEEE80211_M_STA) {
-   /* fake a join to init the tx rate */
-   ic-ic_newassoc(ni, 1);
-   }
 
callout_reset(sc-sc_calib_ch, hz, bwi_calibrate, sc);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209822 - stable/8/sys/dev/bwi

2010-07-08 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul  8 19:40:09 2010
New Revision: 209822
URL: http://svn.freebsd.org/changeset/base/209822

Log:
  MFC r209598:
Initializes the ratectl for a node when the state is changed to RUN.
This prevents a kernel fault by dividing with zero because the initial
rate was 0 and didn't be initialized.
  
Tested by:Warren Block wblock at wonkity.com

Modified:
  stable/8/sys/dev/bwi/if_bwi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/bwi/if_bwi.c
==
--- stable/8/sys/dev/bwi/if_bwi.c   Thu Jul  8 19:36:38 2010
(r209821)
+++ stable/8/sys/dev/bwi/if_bwi.c   Thu Jul  8 19:40:09 2010
(r209822)
@@ -1764,6 +1764,7 @@ static int
 bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
struct bwi_vap *bvp = BWI_VAP(vap);
+   const struct ieee80211_txparam *tp;
struct ieee80211com *ic= vap-iv_ic;
struct ifnet *ifp = ic-ic_ifp;
enum ieee80211_state ostate = vap-iv_state;
@@ -1817,6 +1818,11 @@ bwi_newstate(struct ieee80211vap *vap, e
sc-sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
 
+   /* Initializes ratectl for a node. */
+   tp = vap-iv_txparms[ieee80211_chan2mode(ic-ic_curchan)];
+   if (tp-ucastrate == IEEE80211_FIXED_RATE_NONE)
+   ieee80211_ratectl_node_init(vap-iv_bss);
+
callout_reset(sc-sc_calib_ch, hz, bwi_calibrate, sc);
}
 back:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209619 - head/share/man/man4

2010-06-30 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul  1 00:33:50 2010
New Revision: 209619
URL: http://svn.freebsd.org/changeset/base/209619

Log:
  Adds `Dell Truemobile 1300' to the supported list.
  
  Submitted by: Warren Block wblock at wonkity.com

Modified:
  head/share/man/man4/bwi.4

Modified: head/share/man/man4/bwi.4
==
--- head/share/man/man4/bwi.4   Thu Jul  1 00:30:35 2010(r209618)
+++ head/share/man/man4/bwi.4   Thu Jul  1 00:33:50 2010(r209619)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 16, 2009
+.Dd June 30, 2009
 .Dt BWI 4
 .Os
 .Sh NAME
@@ -82,6 +82,7 @@ driver supports Broadcom BCM43xx based w
 .It Buffalo WLI-PCI-G54S  BCM4306 PCI b/g
 .It Compaq R4035 onboard  BCM4306 PCI b/g
 .It Dell Wireless 1470BCM4318 Mini PCIb/g
+.It Dell Truemobile 1300 r2   BCM4306 Mini PCIb/g
 .It Dell Truemobile 1400  BCM4309 Mini PCIb/g
 .It HP nx6125 BCM4319 PCI b/g
 .It Linksys WPC54G Ver 3  BCM4318 CardBus b/g
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209597 - head/sys/dev/bwi

2010-06-29 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jun 29 21:52:40 2010
New Revision: 209597
URL: http://svn.freebsd.org/changeset/base/209597

Log:
  Fixes NULL pointer reference that it's occurred when the state is
  changed to RUN because ic-ic_newassoc isn't set anywhere now.  In the
  previous bwi_newassoc() is used to initialize AMRR rate routines.
  
  Tested by:Warren Block wblock at wonkity.com
  MFC after:3 days

Modified:
  head/sys/dev/bwi/if_bwi.c

Modified: head/sys/dev/bwi/if_bwi.c
==
--- head/sys/dev/bwi/if_bwi.c   Tue Jun 29 20:55:12 2010(r209596)
+++ head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:52:40 2010(r209597)
@@ -1774,7 +1774,6 @@ bwi_newstate(struct ieee80211vap *vap, e
enum ieee80211_state ostate = vap-iv_state;
struct bwi_softc *sc = ifp-if_softc;
struct bwi_mac *mac;
-   struct ieee80211_node *ni = vap-iv_bss;
int error;
 
BWI_LOCK(sc);
@@ -1822,10 +1821,6 @@ bwi_newstate(struct ieee80211vap *vap, e
 #else
sc-sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
-   if (vap-iv_opmode == IEEE80211_M_STA) {
-   /* fake a join to init the tx rate */
-   ic-ic_newassoc(ni, 1);
-   }
 
callout_reset(sc-sc_calib_ch, hz, bwi_calibrate, sc);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r209598 - head/sys/dev/bwi

2010-06-29 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jun 29 21:56:42 2010
New Revision: 209598
URL: http://svn.freebsd.org/changeset/base/209598

Log:
  Initializes the ratectl for a node when the state is changed to RUN.
  This prevents a kernel fault by dividing with zero because the initial
  rate was 0 and didn't be initialized.
  
  Tested by:Warren Block wblock at wonkity.com
  MFC after:3 days

Modified:
  head/sys/dev/bwi/if_bwi.c

Modified: head/sys/dev/bwi/if_bwi.c
==
--- head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:52:40 2010(r209597)
+++ head/sys/dev/bwi/if_bwi.c   Tue Jun 29 21:56:42 2010(r209598)
@@ -1769,6 +1769,7 @@ static int
 bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
struct bwi_vap *bvp = BWI_VAP(vap);
+   const struct ieee80211_txparam *tp;
struct ieee80211com *ic= vap-iv_ic;
struct ifnet *ifp = ic-ic_ifp;
enum ieee80211_state ostate = vap-iv_state;
@@ -1822,6 +1823,11 @@ bwi_newstate(struct ieee80211vap *vap, e
sc-sc_txpwrcb_type = BWI_TXPWR_CALIB;
 #endif
 
+   /* Initializes ratectl for a node. */
+   tp = vap-iv_txparms[ieee80211_chan2mode(ic-ic_curchan)];
+   if (tp-ucastrate == IEEE80211_FIXED_RATE_NONE)
+   ieee80211_ratectl_node_init(vap-iv_bss);
+
callout_reset(sc-sc_calib_ch, hz, bwi_calibrate, sc);
}
 back:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r208523 - stable/8/sys/dev/bwn

2010-05-24 Thread Weongyo Jeong
Author: weongyo
Date: Mon May 24 21:01:37 2010
New Revision: 208523
URL: http://svn.freebsd.org/changeset/base/208523

Log:
  MFC r208120:
- fixes a bug that it didn't initialize the ratectl after association;
  so ni_txrate returned 0 which is a invalid result.
- The fourth argument of ieee80211_ratectl_tx_complete() could be not
  NULL.
  
Reported by:  Gustau P?rez gperez at entel.upc.edu
Tested by:Gustau P?rez gperez at entel.upc.edu,
  Ian FREISLICH ianf at clue.co.za

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Mon May 24 20:09:40 2010
(r208522)
+++ stable/8/sys/dev/bwn/if_bwn.c   Mon May 24 21:01:37 2010
(r208523)
@@ -8329,6 +8329,7 @@ bwn_phy_reset(struct bwn_mac *mac)
 static int
 bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
+   const struct ieee80211_txparam *tp;
struct bwn_vap *bvp = BWN_VAP(vap);
struct ieee80211com *ic= vap-iv_ic;
struct ifnet *ifp = ic-ic_ifp;
@@ -8377,6 +8378,11 @@ bwn_newstate(struct ieee80211vap *vap, e
bwn_set_pretbtt(mac);
bwn_spu_setdelay(mac, 0);
bwn_set_macaddr(mac);
+
+   /* Initializes ratectl for a node. */
+   tp = vap-iv_txparms[ieee80211_chan2mode(ic-ic_curchan)];
+   if (tp-ucastrate == IEEE80211_FIXED_RATE_NONE)
+   ieee80211_ratectl_node_init(vap-iv_bss);
}
 
BWN_UNLOCK(sc);
@@ -8994,7 +9000,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
struct bwn_stats *stats = mac-mac_stats;
struct ieee80211_node *ni;
struct ieee80211vap *vap;
-   int slot;
+   int retrycnt = 0, slot;
 
BWN_ASSERT_LOCKED(mac-mac_sc);
 
@@ -9027,7 +9033,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
status-ack ?
  IEEE80211_RATECTL_TX_SUCCESS :
  IEEE80211_RATECTL_TX_FAILURE,
-   NULL, 0);
+   retrycnt, 0);
break;
}
slot = bwn_dma_nextslot(dr, slot);
@@ -9048,7 +9054,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
status-ack ?
  IEEE80211_RATECTL_TX_SUCCESS :
  IEEE80211_RATECTL_TX_FAILURE,
-   NULL, 0);
+   retrycnt, 0);
}
bwn_pio_handle_txeof(mac, status);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r208120 - head/sys/dev/bwn

2010-05-15 Thread Weongyo Jeong
Author: weongyo
Date: Sat May 15 21:18:15 2010
New Revision: 208120
URL: http://svn.freebsd.org/changeset/base/208120

Log:
  - fixes a bug that it didn't initialize the ratectl after association;
so ni_txrate returned 0 which is a invalid result.
  - The fourth argument of ieee80211_ratectl_tx_complete() could be not
NULL.
  
  Reported by:  Gustau P?rez gperez at entel.upc.edu
  Tested by:Gustau P?rez gperez at entel.upc.edu,
Ian FREISLICH ianf at clue.co.za
  MFC after:3 days

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat May 15 20:26:10 2010(r208119)
+++ head/sys/dev/bwn/if_bwn.c   Sat May 15 21:18:15 2010(r208120)
@@ -8329,6 +8329,7 @@ bwn_phy_reset(struct bwn_mac *mac)
 static int
 bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
+   const struct ieee80211_txparam *tp;
struct bwn_vap *bvp = BWN_VAP(vap);
struct ieee80211com *ic= vap-iv_ic;
struct ifnet *ifp = ic-ic_ifp;
@@ -8377,6 +8378,11 @@ bwn_newstate(struct ieee80211vap *vap, e
bwn_set_pretbtt(mac);
bwn_spu_setdelay(mac, 0);
bwn_set_macaddr(mac);
+
+   /* Initializes ratectl for a node. */
+   tp = vap-iv_txparms[ieee80211_chan2mode(ic-ic_curchan)];
+   if (tp-ucastrate == IEEE80211_FIXED_RATE_NONE)
+   ieee80211_ratectl_node_init(vap-iv_bss);
}
 
BWN_UNLOCK(sc);
@@ -8994,7 +9000,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
struct bwn_stats *stats = mac-mac_stats;
struct ieee80211_node *ni;
struct ieee80211vap *vap;
-   int slot;
+   int retrycnt = 0, slot;
 
BWN_ASSERT_LOCKED(mac-mac_sc);
 
@@ -9027,7 +9033,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
status-ack ?
  IEEE80211_RATECTL_TX_SUCCESS :
  IEEE80211_RATECTL_TX_FAILURE,
-   NULL, 0);
+   retrycnt, 0);
break;
}
slot = bwn_dma_nextslot(dr, slot);
@@ -9048,7 +9054,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
status-ack ?
  IEEE80211_RATECTL_TX_SUCCESS :
  IEEE80211_RATECTL_TX_FAILURE,
-   NULL, 0);
+   retrycnt, 0);
}
bwn_pio_handle_txeof(mac, status);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r207176 - head/sys/dev/bwn

2010-04-24 Thread Weongyo Jeong
Author: weongyo
Date: Sat Apr 24 23:32:24 2010
New Revision: 207176
URL: http://svn.freebsd.org/changeset/base/207176

Log:
  ifp-if_ipackets++ when RX packet interrupts are occurred.
  
  MFC after:3 days

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat Apr 24 23:20:51 2010(r207175)
+++ head/sys/dev/bwn/if_bwn.c   Sat Apr 24 23:32:24 2010(r207176)
@@ -9368,6 +9368,8 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
rssi = rxhdr-phy.abg.rssi; /* XXX incorrect RSSI calculation? */
noise = mac-mac_stats.link_noise;
 
+   ifp-if_ipackets++;
+
BWN_UNLOCK(sc);
 
ni = ieee80211_find_rxnode(ic, wh);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206928 - in stable/8/sys: dev/siba modules/siba_bwn

2010-04-20 Thread Weongyo Jeong
)  SIBA_IDHIGH_RCHI_SHIFT;
+   rev = (idhi  SIBA_IDHIGH_REVLO);
+   rev |= (idhi  SIBA_IDHIGH_REVHI)  SIBA_IDHIGH_REVHI_SHIFT;
 
sdi-sdi_vid = vendorid;
sdi-sdi_devid = devid;
@@ -500,7 +480,7 @@ siba_setup_devinfo(device_t dev, uint8_t
/*
 * Determine memory window on bus and irq if one is needed.
 */
-   baseaddr = sc-sc_maddr + (idx * SIBA_CORE_LEN);
+   baseaddr = sc-siba_maddr + (idx * SIBA_CORE_LEN);
resource_list_add(sdi-sdi_rl, SYS_RES_MEMORY,
MIPS_MEM_RID, /* XXX */
baseaddr, baseaddr + SIBA_CORE_LEN - 1, SIBA_CORE_LEN);

Copied: stable/8/sys/dev/siba/siba_bwn.c (from r203319, 
head/sys/dev/siba/siba_bwn.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/8/sys/dev/siba/siba_bwn.cTue Apr 20 21:29:53 2010
(r206928, copy of r203319, head/sys/dev/siba/siba_bwn.c)
@@ -0,0 +1,366 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong weon...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the NO WARRANTY disclaimer below (Disclaimer) and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+/*
+ * Sonics Silicon Backplane front-end for bwn(4).
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/module.h
+#include sys/kernel.h
+#include sys/lock.h
+#include sys/mutex.h
+#include sys/errno.h
+#include machine/bus.h
+#include machine/resource.h
+#include sys/bus.h
+#include sys/rman.h
+#include sys/socket.h
+
+#include net/if.h
+#include net/if_media.h
+#include net/if_arp.h
+
+#include dev/pci/pcivar.h
+#include dev/pci/pcireg.h
+
+#include dev/siba/siba_ids.h
+#include dev/siba/sibareg.h
+#include dev/siba/sibavar.h
+
+/*
+ * PCI glue.
+ */
+
+struct siba_bwn_softc {
+   /* Child driver using MSI. */
+   device_tssc_msi_child;
+   struct siba_softc   ssc_siba;
+};
+
+#defineBS_BAR  0x10
+#definePCI_VENDOR_BROADCOM 0x14e4
+#defineN(a)(sizeof(a) / sizeof(a[0]))
+
+static const struct siba_dev {
+   uint16_tvid;
+   uint16_tdid;
+   const char  *desc;
+} siba_devices[] = {
+   { PCI_VENDOR_BROADCOM, 0x4301, Broadcom BCM4301 802.11b Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4306, Unknown },
+   { PCI_VENDOR_BROADCOM, 0x4307, Broadcom BCM4307 802.11b Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4311, Broadcom BCM4311 802.11b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4312,
+ Broadcom BCM4312 802.11a/b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4315, Broadcom BCM4312 802.11b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4318, Broadcom BCM4318 802.11b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4319,
+ Broadcom BCM4318 802.11a/b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4320, Broadcom BCM4306 802.11b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4321, Broadcom BCM4306 802.11a Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4324,
+ Broadcom BCM4309 802.11a/b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4325, Broadcom BCM4306 802.11b/g Wireless },
+   { PCI_VENDOR_BROADCOM, 0x4328, Unknown },
+   { PCI_VENDOR_BROADCOM, 0x4329, Unknown },
+   { PCI_VENDOR_BROADCOM, 0x432b, Unknown }
+};
+
+device_t   siba_add_child(device_t, struct siba_softc *, int, const char *,
+   int);
+intsiba_core_attach(struct siba_softc *);
+intsiba_core_detach(struct siba_softc *);
+intsiba_core_suspend(struct

svn commit: r206931 - in stable/8/sys: dev/siba modules

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:35:48 2010
New Revision: 206931
URL: http://svn.freebsd.org/changeset/base/206931

Log:
  MFC r203320:
Hook up the siba_bwn module to the build.

Modified:
  stable/8/sys/modules/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/modules/Makefile
==
--- stable/8/sys/modules/Makefile   Tue Apr 20 21:34:35 2010
(r206930)
+++ stable/8/sys/modules/Makefile   Tue Apr 20 21:35:48 2010
(r206931)
@@ -248,6 +248,7 @@ SUBDIR= ${_3dfx} \
sdhci \
sem \
sf \
+   siba_bwn \
siis \
sis \
sk \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206932 - stable/8/sys/dev/siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:37:47 2010
New Revision: 206932
URL: http://svn.freebsd.org/changeset/base/206932

Log:
  MFC r203944:
supports SPROM rev8 informations properly which are used to support
low-power PHY of bwn(4) and LDO voltage adjustments.

Modified:
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/sibareg.h
  stable/8/sys/dev/siba/sibavar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/siba/siba_core.c
==
--- stable/8/sys/dev/siba/siba_core.c   Tue Apr 20 21:35:48 2010
(r206931)
+++ stable/8/sys/dev/siba/siba_core.c   Tue Apr 20 21:37:47 2010
(r206932)
@@ -1457,6 +1457,9 @@ siba_crc8(uint8_t crc, uint8_t data)
(((__x)  (__mask)) / SIBA_LOWEST_SET_BIT(__mask))
 #defineSIBA_SHIFTOUT(_var, _offset, _mask) 
\
out-_var = SIBA_SHIFTOUT_SUB(in[SIBA_OFFSET(_offset)], (_mask))
+#define SIBA_SHIFTOUT_4(_var, _offset, _mask, _shift)  \
+   out-_var = uint32_t)in[SIBA_OFFSET((_offset)+2)]  16 |   \
+   in[SIBA_OFFSET(_offset)])  (_mask))  (_shift))
 
 static void
 siba_sprom_r123(struct siba_sprom *out, const uint16_t *in)
@@ -1511,6 +1514,7 @@ siba_sprom_r123(struct siba_sprom *out, 
SIBA_SHIFTOUT(gpio1, SIBA_SPROM1_GPIOA, SIBA_SPROM1_GPIOA_P1);
SIBA_SHIFTOUT(gpio2, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P2);
SIBA_SHIFTOUT(gpio3, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P3);
+
SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_A);
SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_BG);
SIBA_SHIFTOUT(tssi_a, SIBA_SPROM1_TSSI, SIBA_SPROM1_TSSI_A);
@@ -1587,22 +1591,61 @@ siba_sprom_r8(struct siba_sprom *out, co
uint16_t v;
 
for (i = 0; i  3; i++) {
-   v = in[SIBA_OFFSET(SIBA_SPROM1_MAC_80211BG) + i];
+   v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i];
*(((uint16_t *)out-mac_80211bg) + i) = htobe16(v);
}
SIBA_SHIFTOUT(ccode, SIBA_SPROM8_CCODE, 0x);
SIBA_SHIFTOUT(bf_lo, SIBA_SPROM8_BFLOW, 0x);
SIBA_SHIFTOUT(bf_hi, SIBA_SPROM8_BFHIGH, 0x);
+   SIBA_SHIFTOUT(bf2_lo, SIBA_SPROM8_BFL2LO, 0x);
+   SIBA_SHIFTOUT(bf2_hi, SIBA_SPROM8_BFL2HI, 0x);
SIBA_SHIFTOUT(ant_a, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_A);
SIBA_SHIFTOUT(ant_bg, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_BG);
SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_MAXP_BG_MASK);
SIBA_SHIFTOUT(tssi_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_TSSI_BG);
SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_MAXP_A_MASK);
SIBA_SHIFTOUT(tssi_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_TSSI_A);
+   SIBA_SHIFTOUT(maxpwr_ah, SIBA_SPROM8_MAXP_AHL,
+   SIBA_SPROM8_MAXP_AH_MASK);
+   SIBA_SHIFTOUT(maxpwr_al, SIBA_SPROM8_MAXP_AHL,
+   SIBA_SPROM8_MAXP_AL_MASK);
SIBA_SHIFTOUT(gpio0, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P0);
SIBA_SHIFTOUT(gpio1, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P1);
SIBA_SHIFTOUT(gpio2, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P2);
SIBA_SHIFTOUT(gpio3, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P3);
+   SIBA_SHIFTOUT(tri2g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI2G);
+   SIBA_SHIFTOUT(tri5g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI5G);
+   SIBA_SHIFTOUT(tri5gl, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GL);
+   SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH);
+   SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G);
+   SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G);
+   SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G);
+   SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G);
+   SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G);
+   SIBA_SHIFTOUT(bxa2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_BXA2G);
+   SIBA_SHIFTOUT(rssismf5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMF5G);
+   SIBA_SHIFTOUT(rssismc5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMC5G);
+   SIBA_SHIFTOUT(rssisav5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISAV5G);
+   SIBA_SHIFTOUT(bxa5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_BXA5G);
+
+   SIBA_SHIFTOUT(pa0b0, SIBA_SPROM8_PA0B0, 0x);
+   SIBA_SHIFTOUT(pa0b1, SIBA_SPROM8_PA0B1, 0x);
+   SIBA_SHIFTOUT(pa0b2, SIBA_SPROM8_PA0B2, 0x);
+   SIBA_SHIFTOUT(pa1b0, 

svn commit: r206933 - in stable/8/sys: dev/bwn dev/siba modules/bwn

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:40:09 2010
New Revision: 206933
URL: http://svn.freebsd.org/changeset/base/206933

Log:
  MFC r203945:
adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.
  
  o uses v4 firmware instead of v3.  A port will be committed to
create the bwn firmware module.
  o supports B/G and LP(low power) PHYs.
  o supports 32 / 64 bits DMA operations.
  o tested on big / little endian machines so should work on all
architectures.
  
It'd not connected to the build until the firmware port is committed.

Added:
  stable/8/sys/dev/bwn/
 - copied from r203945, head/sys/dev/bwn/
  stable/8/sys/modules/bwn/
 - copied from r203945, head/sys/modules/bwn/
Modified:
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206934 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:41:43 2010
New Revision: 206934
URL: http://svn.freebsd.org/changeset/base/206934

Log:
  MFC r204081:
o print msgs with length if the frame is too short to pass to
  net80211.
o print key index for debugging if the frame is attempted to decrypt
  for WEP, AES or TKIP though currently HW decryption isn't supported.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:40:09 2010
(r206933)
+++ stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:41:43 2010
(r206934)
@@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 
padding = (macstat  BWN_RX_MAC_PADDING) ? 2 : 0;
if (m-m_pkthdr.len  (sizeof(struct bwn_plcp6) + padding)) {
-   device_printf(sc-sc_dev, RX: Packet size underrun (1)\n);
+   device_printf(sc-sc_dev, frame too short (length=%d)\n,
+   m-m_pkthdr.len);
goto drop;
}
plcp = (struct bwn_plcp6 *)(mp + padding);
m_adj(m, sizeof(struct bwn_plcp6) + padding);
if (m-m_pkthdr.len  IEEE80211_MIN_LEN) {
-   device_printf(sc-sc_dev, RX: Packet size underrun (2)\n);
+   device_printf(sc-sc_dev, frame too short (length=%d)\n,
+   m-m_pkthdr.len);
goto drop;
}
wh = mtod(m, struct ieee80211_frame_min *);
 
if (macstat  BWN_RX_MAC_DEC)
-   device_printf(sc-sc_dev, TODO: BWN_RX_MAC_DEC\n);
+   device_printf(sc-sc_dev,
+   RX decryption attempted (old %d keyidx %#x)\n,
+   BWN_ISOLDFMT(mac),
+   (macstat  BWN_RX_MAC_KEYIDX)  BWN_RX_MAC_KEYIDX_SHIFT);
 
/* XXX calculating RSSI  noise  antenna */
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206935 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:48:48 2010
New Revision: 206935
URL: http://svn.freebsd.org/changeset/base/206935

Log:
  MFC r204242:
Fix compilation problems with INVARIANTS.
  
# also limit RX decryption attempted messages to 50
  
Reviewed by:  weongyo
  
  Approved by:  imp (implicit)

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:41:43 2010
(r206934)
+++ stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:48:48 2010
(r206935)
@@ -1496,6 +1496,7 @@ bwn_pio_select(struct bwn_mac *mac, uint
return (mac-mac_method.pio.wme[WME_AC_VO]);
}
KASSERT(0 == 1, (%s:%d: fail, __func__, __LINE__));
+   return (NULL);
 }
 
 static int
@@ -1905,10 +1906,9 @@ bwn_setup_channels(struct bwn_mac *mac, 
 static uint32_t
 bwn_shm_read_4(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-   struct bwn_softc *sc = mac-mac_sc;
uint32_t ret;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset  0x0001) == 0,
@@ -1932,10 +1932,9 @@ out:
 static uint16_t
 bwn_shm_read_2(struct bwn_mac *mac, uint16_t way, uint16_t offset)
 {
-   struct bwn_softc *sc = mac-mac_sc;
uint16_t ret;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset  0x0001) == 0,
@@ -1970,9 +1969,7 @@ static void
 bwn_shm_write_4(struct bwn_mac *mac, uint16_t way, uint16_t offset,
 uint32_t value)
 {
-   struct bwn_softc *sc = mac-mac_sc;
-
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset  0x0001) == 0,
@@ -1995,9 +1992,7 @@ static void
 bwn_shm_write_2(struct bwn_mac *mac, uint16_t way, uint16_t offset,
 uint16_t value)
 {
-   struct bwn_softc *sc = mac-mac_sc;
-
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
if (way == BWN_SHARED) {
KASSERT((offset  0x0001) == 0,
@@ -3335,10 +3330,9 @@ bwn_core_start(struct bwn_mac *mac)
 static void
 bwn_core_exit(struct bwn_mac *mac)
 {
-   struct bwn_softc *sc = mac-mac_sc;
uint32_t macctl;
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
KASSERT(mac-mac_status = BWN_MAC_STATUS_INITED,
(%s:%d: fail, __func__, __LINE__));
@@ -5198,6 +5192,8 @@ bwn_rf_init_bcm2050(struct bwn_mac *mac)
0x0e, 0x0f, 0x0d, 0x0f,
};
 
+   loctl = lomask = reg0 = classctl = crs0 = analogoverval = analogover =
+   rfoverval = rfover = cck3 = 0;
radio0 = BWN_RF_READ(mac, 0x43);
radio1 = BWN_RF_READ(mac, 0x51);
radio2 = BWN_RF_READ(mac, 0x52);
@@ -5891,7 +5887,6 @@ static void
 bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon)
 {
struct bwn_phy *phy = mac-mac_phy;
-   struct bwn_softc *sc = mac-mac_sc;
unsigned int i, max_loop;
uint16_t value;
uint32_t buffer[5] = {
@@ -5906,7 +5901,7 @@ bwn_dummy_transmission(struct bwn_mac *m
buffer[0] = 0x000b846e;
}
 
-   BWN_ASSERT_LOCKED(sc);
+   BWN_ASSERT_LOCKED(mac-mac_sc);
 
for (i = 0; i  5; i++)
bwn_ram_write(mac, i * 4, buffer[i]);
@@ -5972,10 +5967,9 @@ bwn_ram_write(struct bwn_mac *mac, uint1
 static void
 bwn_lo_write(struct bwn_mac *mac, struct bwn_loctl *ctl)
 {
-   struct bwn_phy *phy = mac-mac_phy;
uint16_t value;
 
-   KASSERT(phy-type == BWN_PHYTYPE_G,
+   KASSERT(mac-mac_phy-type == BWN_PHYTYPE_G,
(%s:%d: fail, __func__, __LINE__));
 
value = (uint8_t) (ctl-q);
@@ -6570,7 +6564,7 @@ bwn_lo_calibset(struct bwn_mac *mac,
struct bwn_phy_g *pg = phy-phy_g;
struct bwn_loctl loctl = { 0, 0 };
struct bwn_lo_calib *cal;
-   struct bwn_lo_g_value sval;
+   struct bwn_lo_g_value sval = { 0 };
int rxgain;
uint16_t pad, reg, value;
 
@@ -8984,9 +8978,7 @@ bwn_noise_gensample(struct bwn_mac *mac)
 static int
 bwn_dma_freeslot(struct bwn_dma_ring *dr)
 {
-   struct bwn_mac *mac = dr-dr_mac;
-
-   BWN_ASSERT_LOCKED(mac-mac_sc);
+   BWN_ASSERT_LOCKED(dr-dr_mac-mac_sc);
 
return (dr-dr_numslots - dr-dr_usedslot);
 }
@@ -8994,9 +8986,7 @@ 

svn commit: r206937 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:51:45 2010
New Revision: 206937
URL: http://svn.freebsd.org/changeset/base/206937

Log:
  MFC r204256:
fixes a compile error; invalid type argument of '-'.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:51:28 2010
(r206936)
+++ stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:51:45 2010
(r206937)
@@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct
 {
uint16_t value;
 
-   KASSERT(mac-mac_phy-type == BWN_PHYTYPE_G,
+   KASSERT(mac-mac_phy.type == BWN_PHYTYPE_G,
(%s:%d: fail, __func__, __LINE__));
 
value = (uint8_t) (ctl-q);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206938 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:52:54 2010
New Revision: 206938
URL: http://svn.freebsd.org/changeset/base/206938

Log:
  MFC r204257:
o adds sysctl variables to show device statistics.
o records RTS success/fail statistics.
  
Pointed by:   imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:51:45 2010
(r206937)
+++ stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 21:52:54 2010
(r206938)
@@ -536,6 +536,7 @@ static void bwn_phy_lp_gaintbl_write_r2(
struct bwn_txgain_entry);
 static voidbwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int,
struct bwn_txgain_entry);
+static voidbwn_sysctl_node(struct bwn_softc *);
 
 static struct resource_spec bwn_res_spec_legacy[] = {
{ SYS_RES_IRQ,  0,  RF_ACTIVE | RF_SHAREABLE },
@@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc)
struct ifnet *ifp = sc-sc_ifp;
struct siba_dev_softc *sd = sc-sc_sd;
struct siba_sprom *sprom = sd-sd_bus-siba_sprom;
-#ifdef BWN_DEBUG
-   device_t dev = sc-sc_dev;
-#endif
 
ic = ifp-if_l2com;
ic-ic_ifp = ifp;
@@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc)
sc-sc_rx_th.wr_ihdr, sizeof(sc-sc_rx_th),
BWN_RX_RADIOTAP_PRESENT);
 
-#ifdef BWN_DEBUG
-   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
-   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-   debug, CTLFLAG_RW, sc-sc_debug, 0, Debug flags);
-#endif
+   bwn_sysctl_node(sc);
 
if (bootverbose)
ieee80211_announce(ic);
@@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
struct bwn_pio_txqueue *tq;
struct bwn_pio_txpkt *tp = NULL;
struct bwn_softc *sc = mac-mac_sc;
+   struct bwn_stats *stats = mac-mac_stats;
struct ieee80211_node *ni;
int slot;
 
@@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co
device_printf(sc-sc_dev, TODO: STATUS AMPDU\n);
if (status-rtscnt) {
if (status-rtscnt == 0xf)
-   device_printf(sc-sc_dev, TODO: RTS fail\n);
+   stats-rtsfail++;
else
-   device_printf(sc-sc_dev, TODO: RTS ok\n);
+   stats-rts++;
}
 
if (mac-mac_flags  BWN_MAC_FLAG_DMA) {
@@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_
 }
 
 static void
+bwn_sysctl_node(struct bwn_softc *sc)
+{
+   device_t dev = sc-sc_dev;
+   struct bwn_mac *mac;
+   struct bwn_stats *stats;
+
+   /* XXX assume that count of MAC is only 1. */
+
+   if ((mac = sc-sc_curmac) == NULL)
+   return;
+   stats = mac-mac_stats;
+
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   linknoise, CTLFLAG_RW, stats-rts, 0, Noise level);
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   rts, CTLFLAG_RW, stats-rts, 0, RTS);
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   rtsfail, CTLFLAG_RW, stats-rtsfail, 0, RTS failed to send);
+
+#ifdef BWN_DEBUG
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   debug, CTLFLAG_RW, sc-sc_debug, 0, Debug flags);
+#endif
+}
+
+static void
 bwn_identify(driver_t *driver, device_t parent)
 {
 

Modified: stable/8/sys/dev/bwn/if_bwnvar.h
==
--- stable/8/sys/dev/bwn/if_bwnvar.hTue Apr 20 21:51:45 2010
(r206937)
+++ stable/8/sys/dev/bwn/if_bwnvar.hTue Apr 20 21:52:54 2010
(r206938)
@@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header {
 };
 
 struct bwn_stats {
+   int32_t rtsfail;
+   int32_t rts;
int32_t link_noise;
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206939 - in stable/8/sys: dev/siba modules

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 21:55:44 2010
New Revision: 206939
URL: http://svn.freebsd.org/changeset/base/206939

Log:
  MFC r204326:
Add bwn(4) driver to the build.

Modified:
  stable/8/sys/modules/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/modules/Makefile
==
--- stable/8/sys/modules/Makefile   Tue Apr 20 21:52:54 2010
(r206938)
+++ stable/8/sys/modules/Makefile   Tue Apr 20 21:55:44 2010
(r206939)
@@ -41,6 +41,7 @@ SUBDIR=   ${_3dfx} \
${_bktr} \
${_bm} \
bridgestp \
+   bwn \
cam \
${_canbepm} \
${_canbus} \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206940 - stable/8/share/man/man4

2010-04-20 Thread Weongyo Jeong
 wlandev bwn0 ssid my_net \e
+wepmode on wepkey 0x1234567890 weptxkey 1 up
+.Ed
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr cardbus 4 ,
+.Xr intro 4 ,
+.Xr pci 4 ,
+.Xr wlan 4 ,
+.Xr wlan_amrr 4 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Weongyo Jeong
+.Aq weon...@freebsd.org .
+.\.Sh BUGS
+.\Some card based on the BCM4306 and BCM4309 chips do not work properly
+.\on channel 1, 2 and 3.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206951 - in stable/8: sys/boot/forth sys/dev/siba usr.sbin/sysinstall

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 22:55:07 2010
New Revision: 206951
URL: http://svn.freebsd.org/changeset/base/206951

Log:
  MFC r204328:
Add bwn(4) driver.

Modified:
  stable/8/sys/boot/forth/loader.conf
  stable/8/usr.sbin/sysinstall/devices.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)
  stable/8/usr.sbin/sysinstall/   (props changed)

Modified: stable/8/sys/boot/forth/loader.conf
==
--- stable/8/sys/boot/forth/loader.conf Tue Apr 20 22:52:28 2010
(r206950)
+++ stable/8/sys/boot/forth/loader.conf Tue Apr 20 22:55:07 2010
(r206951)
@@ -224,6 +224,7 @@ if_axe_load=NO# ASIX Electronics AX8
 if_bce_load=NO   # Broadcom NetXtreme II Gigabit Ethernet
 if_bfe_load=NO   # Broadcom BCM4401
 if_bge_load=NO   # Broadcom BCM570x PCI Gigabit Ethernet
+if_bwn_load=NO   # Broadcom BCM43xx IEEE 802.11 wireless NICs
 if_cas_load=NO   # Sun Cassini/Cassini+ and NS DP83065 Saturn
 if_cm_load=NO# SMC (90c26, 90c56, 90c66)
 if_cs_load=NO# Crystal Semiconductor CS8920

Modified: stable/8/usr.sbin/sysinstall/devices.c
==
--- stable/8/usr.sbin/sysinstall/devices.c  Tue Apr 20 22:52:28 2010
(r206950)
+++ stable/8/usr.sbin/sysinstall/devices.c  Tue Apr 20 22:55:07 2010
(r206951)
@@ -105,6 +105,7 @@ static struct _devname {
 NETWORK(bfe, Broadcom BCM440x PCI Ethernet card),
 NETWORK(bge, Broadcom BCM570x PCI Gigabit Ethernet card),
 NETWORK(bm,  Apple BMAC Built-in Ethernet),
+NETWORK(bwn, Broadcom BCM43xx IEEE 802.11 wireless adapter),
 NETWORK(cas, Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet),
 NETWORK(cue, CATC USB Ethernet adapter),
 NETWORK(cxgb,Chelsio T3 10Gb Ethernet card),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206961 - stable/8/share/man/man4

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Apr 20 23:59:02 2010
New Revision: 206961
URL: http://svn.freebsd.org/changeset/base/206961

Log:
  MFC  r204343:
Updates what firmware module should be used for LP (low power) PHY
users and bumps date.

Modified:
  stable/8/share/man/man4/bwn.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/bwn.4
==
--- stable/8/share/man/man4/bwn.4   Tue Apr 20 23:45:48 2010
(r206960)
+++ stable/8/share/man/man4/bwn.4   Tue Apr 20 23:59:02 2010
(r206961)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 15, 2010
+.Dd February 25, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -69,6 +69,8 @@ The
 port needs to be installed before
 .Xr ifconfig 8
 will work.
+Most cases you need to use bwn_v4_ucode module but if you are a
+LP (low power) PHY user please uses bwn_v4_lp_ucode module.
 .Sh HARDWARE
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206962 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:01:38 2010
New Revision: 206962
URL: http://svn.freebsd.org/changeset/base/206962

Log:
  MFC  r204385:
don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
handled in later.
  
Reported from: imp, nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Tue Apr 20 23:59:02 2010
(r206961)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:01:38 2010
(r206962)
@@ -9395,8 +9395,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
device_printf(sc-sc_dev, TODO RX: RX_FLAG_FAILED_FCS_CRC\n);
if (phystat0  (BWN_RX_PHYST0_PLCPHCF | BWN_RX_PHYST0_PLCPFV))
device_printf(sc-sc_dev, TODO RX: RX_FLAG_FAILED_PLCP_CRC\n);
-   if (phystat0  BWN_RX_PHYST0_SHORTPRMBL)
-   device_printf(sc-sc_dev, TODO RX: RX_FLAG_SHORTPRE\n);
if (macstat  BWN_RX_MAC_DECERR)
goto drop;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206963 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:02:48 2010
New Revision: 206963
URL: http://svn.freebsd.org/changeset/base/206963

Log:
  MFC r204436:
supports the adhoc demo mode that it's tested on modified aircrack-ng
suite and worked.
  
Submitted by:   Paul B Mahol onemda at gmail dot com

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:01:38 2010
(r206962)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:02:48 2010
(r206963)
@@ -1076,6 +1076,7 @@ bwn_attach_post(struct bwn_softc *sc)
ic-ic_caps =
  IEEE80211_C_STA   /* station mode supported */
| IEEE80211_C_MONITOR   /* monitor mode */
+   | IEEE80211_C_AHDEMO/* adhoc demo mode */
| IEEE80211_C_SHPREAMBLE/* short preamble supported */
| IEEE80211_C_SHSLOT/* short slot time supported */
| IEEE80211_C_WME   /* WME/WMM supported */
@@ -8447,7 +8448,8 @@ bwn_newstate(struct ieee80211vap *vap, e
}
}
 
-   if (vap-iv_opmode == IEEE80211_M_MONITOR) {
+   if (vap-iv_opmode == IEEE80211_M_MONITOR ||
+   vap-iv_opmode == IEEE80211_M_AHDEMO) {
/* XXX nothing to do? */
} else if (nstate == IEEE80211_S_RUN) {
memcpy(sc-sc_bssid, vap-iv_bss-ni_bssid, IEEE80211_ADDR_LEN);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206964 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:05:22 2010
New Revision: 206964
URL: http://svn.freebsd.org/changeset/base/206964

Log:
  MFC r204437:
fixes a bug to load firmware images for LP PHY. For LP PHY always,
`lp_' string is contained in its full image names.

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:02:48 2010
(r206963)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:05:22 2010
(r206964)
@@ -7789,8 +7789,9 @@ bwn_fw_get(struct bwn_mac *mac, enum bwn
bwn_do_release_fw(bfw);
}
 
-   snprintf(namebuf, sizeof(namebuf), bwn%s_v4_%s,
-   (type == BWN_FWTYPE_OPENSOURCE) ? -open : , name);
+   snprintf(namebuf, sizeof(namebuf), bwn%s_v4_%s%s,
+   (type == BWN_FWTYPE_OPENSOURCE) ? -open : ,
+   (mac-mac_phy.type == BWN_PHYTYPE_LP) ? lp_ : , name);
/* XXX Sleeping on fwload with the non-sleepable locks held */
fw = firmware_get(namebuf);
if (fw == NULL) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206965 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:06:39 2010
New Revision: 206965
URL: http://svn.freebsd.org/changeset/base/206965

Log:
  MFC r204542:
calculates the integer square root if a positive integer X is larger
than 256 instead of using sqrt_table.
  
Reported by: Joe Marcus Clarke marcus at freebsd dot org

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:05:22 2010
(r206964)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:06:39 2010
(r206965)
@@ -12846,7 +12846,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *ma
 static unsigned int
 bwn_sqrt(struct bwn_mac *mac, unsigned int x)
 {
-   struct bwn_softc *sc = mac-mac_sc;
/* Table holding (10 * sqrt(x)) for x between 1 and 256. */
static uint8_t sqrt_table[256] = {
10, 14, 17, 20, 22, 24, 26, 28,
@@ -12886,9 +12885,11 @@ bwn_sqrt(struct bwn_mac *mac, unsigned i
if (x == 0)
return (0);
if (x = 256) {
-   device_printf(sc-sc_dev,
-   out of bounds of the square-root table (%d)\n, x);
-   return (16);
+   unsigned int tmp;
+
+   for (tmp = 0; x = (2 * tmp) + 1; x -= (2 * tmp++) + 1)
+   /* do nothing */ ;
+   return (tmp);
}
return (sqrt_table[x - 1] / 10);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206967 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:13:44 2010
New Revision: 206967
URL: http://svn.freebsd.org/changeset/base/206967

Log:
  MFC r204657:
fixes an attached-at-boot issue that bwn(4) using device_identify
interface didn't be attached automatically at boot time so changes a
approach to attach children based on leveraging some newbus niceties.
  
Submitted by: nwhitehorn

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_core.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:10:30 2010
(r206966)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:13:44 2010
(r206967)
@@ -14312,16 +14312,8 @@ bwn_sysctl_node(struct bwn_softc *sc)
 #endif
 }
 
-static void
-bwn_identify(driver_t *driver, device_t parent)
-{
-
-   BUS_ADD_CHILD(parent, 0, bwn, -1);
-}
-
 static device_method_t bwn_methods[] = {
/* Device interface */
-   DEVMETHOD(device_identify,  bwn_identify),
DEVMETHOD(device_probe, bwn_probe),
DEVMETHOD(device_attach,bwn_attach),
DEVMETHOD(device_detach,bwn_detach),

Modified: stable/8/sys/dev/siba/siba_bwn.c
==
--- stable/8/sys/dev/siba/siba_bwn.cWed Apr 21 00:10:30 2010
(r206966)
+++ stable/8/sys/dev/siba/siba_bwn.cWed Apr 21 00:13:44 2010
(r206967)
@@ -97,8 +97,6 @@ static const struct siba_dev {
{ PCI_VENDOR_BROADCOM, 0x432b, Unknown }
 };
 
-device_t   siba_add_child(device_t, struct siba_softc *, int, const char *,
-   int);
 intsiba_core_attach(struct siba_softc *);
 intsiba_core_detach(struct siba_softc *);
 intsiba_core_suspend(struct siba_softc *);
@@ -238,15 +236,6 @@ siba_bwn_resume(device_t dev)
return (0);
 }
 
-static device_t
-siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
-{
-   struct siba_bwn_softc *ssc = device_get_softc(dev);
-   struct siba_softc *siba = ssc-ssc_siba;
-
-   return (siba_add_child(dev, siba, order, name, unit));
-}
-
 /* proxying to the parent */
 static struct resource *
 siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
@@ -342,7 +331,6 @@ static device_method_t siba_bwn_methods[
DEVMETHOD(device_resume,siba_bwn_resume),
 
/* Bus interface */
-   DEVMETHOD(bus_add_child,siba_bwn_add_child),
DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
DEVMETHOD(bus_setup_intr,   siba_bwn_setup_intr),

Modified: stable/8/sys/dev/siba/siba_core.c
==
--- stable/8/sys/dev/siba/siba_core.c   Wed Apr 21 00:10:30 2010
(r206966)
+++ stable/8/sys/dev/siba/siba_core.c   Wed Apr 21 00:13:44 2010
(r206967)
@@ -133,8 +133,6 @@ static void siba_pci_write_multi_4(struc
size_t, uint16_t);
 static const char *siba_core_name(uint16_t);
 static voidsiba_pcicore_init(struct siba_pci *);
-device_t   siba_add_child(device_t, struct siba_softc *, int, const char *,
-   int);
 intsiba_core_attach(struct siba_softc *);
 intsiba_core_detach(struct siba_softc *);
 intsiba_core_suspend(struct siba_softc *);
@@ -206,8 +204,10 @@ siba_core_attach(struct siba_softc *siba
return (error);
}
 
+   siba_pcicore_init(siba-siba_pci);
siba_powerdown(siba);
-   return (0);
+   
+   return (bus_generic_attach(siba-siba_dev));
 }
 
 int
@@ -277,6 +277,7 @@ siba_scan(struct siba_softc *siba)
 {
struct siba_dev_softc *sd;
uint32_t idhi, tmp;
+   device_t child;
int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
n_pci = 0;
 
@@ -387,6 +388,14 @@ siba_scan(struct siba_softc *siba)
break;
}
dev_i++;
+
+   child = device_add_child(siba-siba_dev, NULL, -1);
+   if (child == NULL) {
+   device_printf(siba-siba_dev, child attach failed\n);
+   continue;
+   }
+
+   device_set_ivars(child, sd);
}
siba-siba_ndevs = 

svn commit: r206968 - in stable/8/sys: conf dev/siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:15:58 2010
New Revision: 206968
URL: http://svn.freebsd.org/changeset/base/206968

Log:
  MFC r204662:
Hook up the bwn driver.
  
Pointed by: nwhitehorn

Modified:
  stable/8/sys/conf/files
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/conf/files
==
--- stable/8/sys/conf/files Wed Apr 21 00:13:44 2010(r206967)
+++ stable/8/sys/conf/files Wed Apr 21 00:15:58 2010(r206968)
@@ -771,6 +771,7 @@ dev/bwi/bwiphy.coptional bwi
 dev/bwi/bwirf.coptional bwi
 dev/bwi/if_bwi.c   optional bwi
 dev/bwi/if_bwi_pci.c   optional bwi pci
+dev/bwn/if_bwn.c   optional bwn siba_bwn
 dev/cardbus/cardbus.c  optional cardbus
 dev/cardbus/cardbus_cis.c  optional cardbus
 dev/cardbus/cardbus_device.c   optional cardbus
@@ -1481,6 +1482,8 @@ dev/si/si3_t225.c optional si
 dev/si/si_eisa.c   optional si eisa
 dev/si/si_isa.coptional si isa
 dev/si/si_pci.coptional si pci
+dev/siba/siba_bwn.coptional siba_bwn pci
+dev/siba/siba_core.c   optional siba_bwn pci
 dev/siis/siis.coptional siis pci
 dev/sis/if_sis.c   optional sis pci
 dev/sk/if_sk.c optional sk pci inet
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206969 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:22:16 2010
New Revision: 206969
URL: http://svn.freebsd.org/changeset/base/206969

Log:
  MFC r205003:
Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug
and non-debug cases
  
  MFC r204992:
fixes a compile error if INVARIANTS is disabled.
  
Pointy hat to: me
Submitted by: Michael Butler imb at protected-networks dot net
  
  MFC r204983:
Fix build breakage introduced in r204922.
  
  MFC r204923:
uses KOBJMETHOD_END macro to indicate the end of method table.
  
Submitted by: yongari
  
  MFC r204922:
o uses bus accessor macros to read values from ivar so no more values
  are referenced directly from ivar pointer.  It's to do like what other
  buses do. [1]
o changes exported prototypes.  It doesn't use struct siba_* structures
  anymore that instead of it it uses only device_t.
o removes duplicate code and debug messages.
o style(9)
  
Pointed out by:imp [1]

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
  stable/8/sys/dev/siba/siba.c
  stable/8/sys/dev/siba/siba_bwn.c
  stable/8/sys/dev/siba/siba_cc.c   (contents, props changed)
  stable/8/sys/dev/siba/siba_core.c
  stable/8/sys/dev/siba/siba_pcib.c
  stable/8/sys/dev/siba/sibavar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:15:58 2010
(r206968)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:22:16 2010
(r206969)
@@ -134,7 +134,7 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFL
 
 static int bwn_attach_pre(struct bwn_softc *);
 static int bwn_attach_post(struct bwn_softc *);
-static voidbwn_sprom_bugfixes(struct siba_softc *);
+static voidbwn_sprom_bugfixes(device_t);
 static voidbwn_init(void *);
 static int bwn_init_locked(struct bwn_softc *);
 static int bwn_ioctl(struct ifnet *, u_long, caddr_t);
@@ -205,7 +205,6 @@ static void bwn_stop_locked(struct bwn_s
 static int bwn_core_init(struct bwn_mac *);
 static voidbwn_core_start(struct bwn_mac *);
 static voidbwn_core_exit(struct bwn_mac *);
-static voidbwn_fix_imcfglobug(struct bwn_mac *);
 static voidbwn_bt_disable(struct bwn_mac *);
 static int bwn_chip_init(struct bwn_mac *);
 static uint64_tbwn_hf_read(struct bwn_mac *);
@@ -225,7 +224,6 @@ static int  bwn_fw_loadinitvals(struct bw
 static int bwn_phy_init(struct bwn_mac *);
 static voidbwn_set_txantenna(struct bwn_mac *, int);
 static voidbwn_set_opmode(struct bwn_mac *);
-static voidbwn_gpio_cleanup(struct bwn_mac *);
 static voidbwn_rate_write(struct bwn_mac *, uint16_t, int);
 static uint8_t bwn_plcp_getcck(const uint8_t);
 static uint8_t bwn_plcp_getofdm(const uint8_t);
@@ -910,13 +908,12 @@ static const struct siba_devid bwn_devs[
 static int
 bwn_probe(device_t dev)
 {
-   struct siba_dev_softc *sd = device_get_ivars(dev);
int i;
 
for (i = 0; i  sizeof(bwn_devs) / sizeof(bwn_devs[0]); i++) {
-   if (sd-sd_id.sd_vendor == bwn_devs[i].sd_vendor 
-   sd-sd_id.sd_device == bwn_devs[i].sd_device 
-   sd-sd_id.sd_rev == bwn_devs[i].sd_rev)
+   if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor 
+   siba_get_device(dev) == bwn_devs[i].sd_device 
+   siba_get_revid(dev) == bwn_devs[i].sd_rev)
return (BUS_PROBE_DEFAULT);
}
 
@@ -928,12 +925,9 @@ bwn_attach(device_t dev)
 {
struct bwn_mac *mac;
struct bwn_softc *sc = device_get_softc(dev);
-   struct siba_dev_softc *sd = device_get_ivars(dev);
-   struct siba_softc *siba = sd-sd_bus;
int error, i, msic, reg;
 
sc-sc_dev = dev;
-   sc-sc_sd = sd;
 #ifdef BWN_DEBUG
sc-sc_debug = bwn_debug;
 #endif
@@ -942,14 +936,14 @@ bwn_attach(device_t dev)
error = bwn_attach_pre(sc);
if (error != 0)
return (error);
-   bwn_sprom_bugfixes(sd-sd_bus);
+   bwn_sprom_bugfixes(dev);
sc-sc_flags |= BWN_FLAG_ATTACHED;
}
 
if (!TAILQ_EMPTY(sc-sc_maclist)) {
-   if (siba-siba_pci_did != 0x4313 
-   siba-siba_pci_did != 0x431a 
-   siba-siba_pci_did != 0x4321) {
+   if (siba_get_pci_device(dev) != 0x4313 
+   siba_get_pci_device(dev) != 0x431a 
+   

svn commit: r206970 - in stable/8/sys/dev: bwn siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:23:23 2010
New Revision: 206970
URL: http://svn.freebsd.org/changeset/base/206970

Log:
  MFC r205141:
enables S/W beacon miss handler.
  
Reported by:imp

Modified:
  stable/8/sys/dev/bwn/if_bwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/bwn/if_bwn.c
==
--- stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:22:16 2010
(r206969)
+++ stable/8/sys/dev/bwn/if_bwn.c   Wed Apr 21 00:23:23 2010
(r206970)
@@ -1076,6 +1076,8 @@ bwn_attach_post(struct bwn_softc *sc)
| IEEE80211_C_TXPMGT/* capable of txpow mgt */
;
 
+   ic-ic_flags_ext |= IEEE80211_FEXT_SWBMISS; /* s/w bmiss */
+
/* call MI attach routine. */
ieee80211_ifattach(ic,
bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc-sc_dev)) ?
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206971 - stable/8/sys/dev/siba

2010-04-20 Thread Weongyo Jeong
Author: weongyo
Date: Wed Apr 21 00:26:41 2010
New Revision: 206971
URL: http://svn.freebsd.org/changeset/base/206971

Log:
  remove svn:mergeinfo properties committed during my MFCs.

Modified:
Directory Properties:
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/dev/siba/siba_cc.c   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206775 - stable/8/share/man/man4

2010-04-17 Thread Weongyo Jeong
Author: weongyo
Date: Sat Apr 17 22:52:33 2010
New Revision: 206775
URL: http://svn.freebsd.org/changeset/base/206775

Log:
  MFC r197724:
TRENDnet TEW-424UB has multiple revisions so clarify zyd(4) man page and
adds a device to urtw(4).  The revision informations are as follows:
  
rev A   ZD1211
V2  SiS163U
V2.1R   SiS163U
V3.xR   RTL8187B
  
and bump date.
  
Obtained from:  OpenBSD
Reported by:Albert Shih Albert.Shih at obspm.fr

Modified:
  stable/8/share/man/man4/urtw.4
  stable/8/share/man/man4/zyd.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/urtw.4
==
--- stable/8/share/man/man4/urtw.4  Sat Apr 17 22:40:15 2010
(r206774)
+++ stable/8/share/man/man4/urtw.4  Sat Apr 17 22:52:33 2010
(r206775)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 25, 2009
+.Dd October 2, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
@@ -73,6 +73,7 @@ driver supports Realtek RTL8187B/L based
 .It Netgear WG111v2   RTL8225 USB
 .It Safehome WLG-1500SMA5 RTL8225 USB
 .It Shuttle XPC Accessory PN20RTL8225 USB
+.It TRENDnet TEW-424UB V3.xR  RTL8225 USB
 .El
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):

Modified: stable/8/share/man/man4/zyd.4
==
--- stable/8/share/man/man4/zyd.4   Sat Apr 17 22:40:15 2010
(r206774)
+++ stable/8/share/man/man4/zyd.4   Sat Apr 17 22:52:33 2010
(r206775)
@@ -32,7 +32,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\ THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd November 1, 2008
+.Dd October 2, 2009
 .Dt ZYD 4
 .Os
 .Sh NAME
@@ -113,7 +113,7 @@ driver:
 .It Sweex wireless USB 54 Mbps
 .It Tekram/Siemens USB adapter
 .It Telegent TG54USB
-.It Trendnet TEW-424UB
+.It Trendnet TEW-424UB rev A
 .It Trendnet TEW-429UB
 .It TwinMOS G240
 .It Unicorn WL-54G
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206776 - stable/8/share/man/man4

2010-04-17 Thread Weongyo Jeong
Author: weongyo
Date: Sat Apr 17 22:57:07 2010
New Revision: 206776
URL: http://svn.freebsd.org/changeset/base/206776

Log:
  MFC r198195:
adds devices supportted by urtw(4) and bumps date.

Modified:
  stable/8/share/man/man4/urtw.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/urtw.4
==
--- stable/8/share/man/man4/urtw.4  Sat Apr 17 22:52:33 2010
(r206775)
+++ stable/8/share/man/man4/urtw.4  Sat Apr 17 22:57:07 2010
(r206776)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 2, 2009
+.Dd October 17, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
@@ -70,9 +70,15 @@ driver supports Realtek RTL8187B/L based
 .Pp
 .Bl -column Shuttle XPC Accessory PN20 RTL8225 USB -compact -offset 6n
 .It Em Card   Radio   Bus
+.It Belkin F5D7050E   RTL8225 USB
+.It Linksys WUSB54GCv2RTL8225 USB
 .It Netgear WG111v2   RTL8225 USB
+.It Netgear WG111v3   RTL8225 USB
 .It Safehome WLG-1500SMA5 RTL8225 USB
 .It Shuttle XPC Accessory PN20RTL8225 USB
+.It Sitecom WL168v1   RTL8225 USB
+.It Sitecom WL168v4   RTL8225 USB
+.It SureCom EP-9001-g(2A) RTL8225 USB
 .It TRENDnet TEW-424UB V3.xR  RTL8225 USB
 .El
 .Sh EXAMPLES
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206779 - stable/8/etc/devd

2010-04-17 Thread Weongyo Jeong
Author: weongyo
Date: Sat Apr 17 23:14:06 2010
New Revision: 206779
URL: http://svn.freebsd.org/changeset/base/206779

Log:
  MFC r202610:
adds a hardware specific configuration file for uath(4).
  
Pointed by:   sam
Reviewed by:  imp, thompsa

Added:
  stable/8/etc/devd/uath.conf
 - copied unchanged from r202610, head/etc/devd/uath.conf
Modified:
  stable/8/etc/devd/Makefile
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/devd/Makefile
==
--- stable/8/etc/devd/Makefile  Sat Apr 17 23:04:56 2010(r206778)
+++ stable/8/etc/devd/Makefile  Sat Apr 17 23:14:06 2010(r206779)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FILES= asus.conf
+FILES= asus.conf uath.conf
 
 NO_OBJ=
 FILESDIR=  /etc/devd

Copied: stable/8/etc/devd/uath.conf (from r202610, head/etc/devd/uath.conf)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/8/etc/devd/uath.conf Sat Apr 17 23:14:06 2010(r206779, copy 
of r202610, head/etc/devd/uath.conf)
@@ -0,0 +1,120 @@
+# $FreeBSD$
+#
+# Atheros USB wireless network device specific devd events
+
+# Accton
+#   SMCWUSB-G and SMCWUSBT-G2
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x083a;
+   match product (0x4505|0x4507);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Atheros Communications
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x168c;
+   match product 0x0002;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Atheros Communications
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0cf3;
+   match product (0x0002|0x0004|0x0006);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Conceptronic
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0d8e;
+   match product (0x7802|0x7812);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# D-Link
+#   DWL-AG132, DWL-G132 and DWL-AG122
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x2001;
+   match product (0x3a01|0x3a03|0x3a05);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# D-Link
+#  DWA-120
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x07d1;
+   match product 0x3a0c;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Gigaset
+#   SMCWUSBT-G
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1690;
+   match product (0x0711|0x0713);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Global Sun Technology
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x16ab;
+   match product (0x7802|0x7812);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# BayNETGEAR
+#   WG111U
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0846;
+   match product 0x4301;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Netgear
+#   WG111T and WPN111
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1385;
+   match product (0x4251|0x5f01);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# U-MEDIA Communications
+#   TEW-444UB and AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x157e;
+   match product (0x3007|0x3206);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Wistron NeWeb
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1435;
+   match product (0x0827|0x0829);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Z-Com
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0cde;
+   match product 0x0013;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r206780 - stable/8/sys/net80211

2010-04-17 Thread Weongyo Jeong
Author: weongyo
Date: Sat Apr 17 23:48:07 2010
New Revision: 206780
URL: http://svn.freebsd.org/changeset/base/206780

Log:
  MFC r205140:
fixes a broken software beacon miss handler.  There is a race to check
vap-iv_bmiss_count == 0 in ieee80211_swbmiss because iv_swbmiss_task
is enqueued by taskqueue.
  
Reviewed by:  rpaulo

Modified:
  stable/8/sys/net80211/ieee80211_proto.c
  stable/8/sys/net80211/ieee80211_sta.c
  stable/8/sys/net80211/ieee80211_tdma.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/dev/uath/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/net80211/ieee80211_proto.c
==
--- stable/8/sys/net80211/ieee80211_proto.c Sat Apr 17 23:14:06 2010
(r206779)
+++ stable/8/sys/net80211/ieee80211_proto.c Sat Apr 17 23:48:07 2010
(r206780)
@@ -1432,8 +1432,6 @@ ieee80211_swbmiss(void *arg)
} else if (vap-iv_swbmiss_count == 0) {
if (vap-iv_bmiss != NULL)
ieee80211_runtask(ic, vap-iv_swbmiss_task);
-   if (vap-iv_bmiss_count == 0)   /* don't re-arm timer */
-   return;
} else
vap-iv_swbmiss_count = 0;
callout_reset(vap-iv_swbmiss, vap-iv_swbmiss_period,

Modified: stable/8/sys/net80211/ieee80211_sta.c
==
--- stable/8/sys/net80211/ieee80211_sta.c   Sat Apr 17 23:14:06 2010
(r206779)
+++ stable/8/sys/net80211/ieee80211_sta.c   Sat Apr 17 23:48:07 2010
(r206780)
@@ -141,6 +141,8 @@ sta_beacon_miss(struct ieee80211vap *vap
vap-iv_bss-ni_essid, vap-iv_bss-ni_esslen);
return;
}
+
+   callout_stop(vap-iv_swbmiss);
vap-iv_bmiss_count = 0;
vap-iv_stats.is_beacon_miss++;
if (vap-iv_roaming == IEEE80211_ROAMING_AUTO) {

Modified: stable/8/sys/net80211/ieee80211_tdma.c
==
--- stable/8/sys/net80211/ieee80211_tdma.c  Sat Apr 17 23:14:06 2010
(r206779)
+++ stable/8/sys/net80211/ieee80211_tdma.c  Sat Apr 17 23:48:07 2010
(r206780)
@@ -295,6 +295,8 @@ tdma_beacon_miss(struct ieee80211vap *va
beacon miss, mode %u state %s\n,
vap-iv_opmode, ieee80211_state_name[vap-iv_state]);
 
+   callout_stop(vap-iv_swbmiss);
+
if (ts-tdma_peer != NULL) {/* XXX? can this be null? */
ieee80211_notify_node_leave(vap-iv_bss);
ts-tdma_peer = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r205140 - head/sys/net80211

2010-03-13 Thread Weongyo Jeong
Author: weongyo
Date: Sun Mar 14 01:57:32 2010
New Revision: 205140
URL: http://svn.freebsd.org/changeset/base/205140

Log:
  fixes a broken software beacon miss handler.  There is a race to check
  vap-iv_bmiss_count == 0 in ieee80211_swbmiss because iv_swbmiss_task is
  enqueued by taskqueue.
  
  Reviewed by:  rpaulo

Modified:
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_proto.c
==
--- head/sys/net80211/ieee80211_proto.c Sun Mar 14 00:32:18 2010
(r205139)
+++ head/sys/net80211/ieee80211_proto.c Sun Mar 14 01:57:32 2010
(r205140)
@@ -1432,8 +1432,6 @@ ieee80211_swbmiss(void *arg)
} else if (vap-iv_swbmiss_count == 0) {
if (vap-iv_bmiss != NULL)
ieee80211_runtask(ic, vap-iv_swbmiss_task);
-   if (vap-iv_bmiss_count == 0)   /* don't re-arm timer */
-   return;
} else
vap-iv_swbmiss_count = 0;
callout_reset(vap-iv_swbmiss, vap-iv_swbmiss_period,

Modified: head/sys/net80211/ieee80211_sta.c
==
--- head/sys/net80211/ieee80211_sta.c   Sun Mar 14 00:32:18 2010
(r205139)
+++ head/sys/net80211/ieee80211_sta.c   Sun Mar 14 01:57:32 2010
(r205140)
@@ -141,6 +141,8 @@ sta_beacon_miss(struct ieee80211vap *vap
vap-iv_bss-ni_essid, vap-iv_bss-ni_esslen);
return;
}
+
+   callout_stop(vap-iv_swbmiss);
vap-iv_bmiss_count = 0;
vap-iv_stats.is_beacon_miss++;
if (vap-iv_roaming == IEEE80211_ROAMING_AUTO) {

Modified: head/sys/net80211/ieee80211_tdma.c
==
--- head/sys/net80211/ieee80211_tdma.c  Sun Mar 14 00:32:18 2010
(r205139)
+++ head/sys/net80211/ieee80211_tdma.c  Sun Mar 14 01:57:32 2010
(r205140)
@@ -295,6 +295,8 @@ tdma_beacon_miss(struct ieee80211vap *va
beacon miss, mode %u state %s\n,
vap-iv_opmode, ieee80211_state_name[vap-iv_state]);
 
+   callout_stop(vap-iv_swbmiss);
+
if (ts-tdma_peer != NULL) {/* XXX? can this be null? */
ieee80211_notify_node_leave(vap-iv_bss);
ts-tdma_peer = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204992 - head/sys/dev/siba

2010-03-10 Thread Weongyo Jeong
Author: weongyo
Date: Thu Mar 11 01:35:38 2010
New Revision: 204992
URL: http://svn.freebsd.org/changeset/base/204992

Log:
  fixes a compile error if INVARIANTS is disabled.
  
  Pointy hat to:me
  Submitted by: Michael Butler imb at protected-networks dot net

Modified:
  head/sys/dev/siba/siba_core.c

Modified: head/sys/dev/siba/siba_core.c
==
--- head/sys/dev/siba/siba_core.c   Thu Mar 11 01:02:27 2010
(r204991)
+++ head/sys/dev/siba/siba_core.c   Thu Mar 11 01:35:38 2010
(r204992)
@@ -2031,11 +2031,11 @@ siba_pcie_mdio_write(struct siba_pci *sp
 uint32_t
 siba_dma_translation(device_t dev)
 {
-   struct siba_dev_softc *sd = device_get_ivars(dev);
-   struct siba_softc *siba = sd-sd_bus;
 
-   KASSERT(siba-siba_type == SIBA_TYPE_PCI,
-   (unsupported bustype %d\n, siba-siba_type));
+   KASSERT(device_get_ivars(dev)-sd_bus-siba_type == SIBA_TYPE_PCI,
+   (unsupported bustype %d\n,
+device_get_ivars(dev)-sd_bus-siba_type));
+
return (SIBA_PCI_DMA);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204922 - in head/sys/dev: bwn siba

2010-03-09 Thread Weongyo Jeong
Author: weongyo
Date: Tue Mar  9 19:58:00 2010
New Revision: 204922
URL: http://svn.freebsd.org/changeset/base/204922

Log:
  o uses bus accessor macros to read values from ivar so no more values
are referenced directly from ivar pointer.  It's to do like what other
buses do. [1]
  o changes exported prototypes.  It doesn't use struct siba_* structures
anymore that instead of it it uses only device_t.
  o removes duplicate code and debug messages.
  o style(9)
  
  Pointed out by:   imp [1]

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnvar.h
  head/sys/dev/siba/siba_bwn.c
  head/sys/dev/siba/siba_core.c
  head/sys/dev/siba/sibavar.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Mar  9 19:57:44 2010(r204921)
+++ head/sys/dev/bwn/if_bwn.c   Tue Mar  9 19:58:00 2010(r204922)
@@ -134,7 +134,7 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFL
 
 static int bwn_attach_pre(struct bwn_softc *);
 static int bwn_attach_post(struct bwn_softc *);
-static voidbwn_sprom_bugfixes(struct siba_softc *);
+static voidbwn_sprom_bugfixes(device_t);
 static voidbwn_init(void *);
 static int bwn_init_locked(struct bwn_softc *);
 static int bwn_ioctl(struct ifnet *, u_long, caddr_t);
@@ -205,7 +205,6 @@ static void bwn_stop_locked(struct bwn_s
 static int bwn_core_init(struct bwn_mac *);
 static voidbwn_core_start(struct bwn_mac *);
 static voidbwn_core_exit(struct bwn_mac *);
-static voidbwn_fix_imcfglobug(struct bwn_mac *);
 static voidbwn_bt_disable(struct bwn_mac *);
 static int bwn_chip_init(struct bwn_mac *);
 static uint64_tbwn_hf_read(struct bwn_mac *);
@@ -225,7 +224,6 @@ static int  bwn_fw_loadinitvals(struct bw
 static int bwn_phy_init(struct bwn_mac *);
 static voidbwn_set_txantenna(struct bwn_mac *, int);
 static voidbwn_set_opmode(struct bwn_mac *);
-static voidbwn_gpio_cleanup(struct bwn_mac *);
 static voidbwn_rate_write(struct bwn_mac *, uint16_t, int);
 static uint8_t bwn_plcp_getcck(const uint8_t);
 static uint8_t bwn_plcp_getofdm(const uint8_t);
@@ -910,13 +908,12 @@ static const struct siba_devid bwn_devs[
 static int
 bwn_probe(device_t dev)
 {
-   struct siba_dev_softc *sd = device_get_ivars(dev);
int i;
 
for (i = 0; i  sizeof(bwn_devs) / sizeof(bwn_devs[0]); i++) {
-   if (sd-sd_id.sd_vendor == bwn_devs[i].sd_vendor 
-   sd-sd_id.sd_device == bwn_devs[i].sd_device 
-   sd-sd_id.sd_rev == bwn_devs[i].sd_rev)
+   if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor 
+   siba_get_device(dev) == bwn_devs[i].sd_device 
+   siba_get_revid(dev) == bwn_devs[i].sd_rev)
return (BUS_PROBE_DEFAULT);
}
 
@@ -928,12 +925,9 @@ bwn_attach(device_t dev)
 {
struct bwn_mac *mac;
struct bwn_softc *sc = device_get_softc(dev);
-   struct siba_dev_softc *sd = device_get_ivars(dev);
-   struct siba_softc *siba = sd-sd_bus;
int error, i, msic, reg;
 
sc-sc_dev = dev;
-   sc-sc_sd = sd;
 #ifdef BWN_DEBUG
sc-sc_debug = bwn_debug;
 #endif
@@ -942,14 +936,14 @@ bwn_attach(device_t dev)
error = bwn_attach_pre(sc);
if (error != 0)
return (error);
-   bwn_sprom_bugfixes(sd-sd_bus);
+   bwn_sprom_bugfixes(dev);
sc-sc_flags |= BWN_FLAG_ATTACHED;
}
 
if (!TAILQ_EMPTY(sc-sc_maclist)) {
-   if (siba-siba_pci_did != 0x4313 
-   siba-siba_pci_did != 0x431a 
-   siba-siba_pci_did != 0x4321) {
+   if (siba_get_pci_device(dev) != 0x4313 
+   siba_get_pci_device(dev) != 0x431a 
+   siba_get_pci_device(dev) != 0x4321) {
device_printf(sc-sc_dev,
skip 802.11 cores\n);
return (ENODEV);
@@ -961,7 +955,6 @@ bwn_attach(device_t dev)
if (mac == NULL)
return (ENOMEM);
mac-mac_sc = sc;
-   mac-mac_sd = sd;
mac-mac_status = BWN_MAC_STATUS_UNINIT;
if (bwn_bfp != 0)
mac-mac_flags |= BWN_MAC_FLAG_BADFRAME_PREEMP;
@@ -977,7 +970,7 @@ bwn_attach(device_t dev)
 
device_printf(sc-sc_dev, WLAN (chipid %#x rev %u) 
PHY (analog %d type %d rev %d) RADIO (manuf %#x ver %#x rev %d)\n,
-   sd-sd_bus-siba_chipid, sd-sd_id.sd_rev,
+   siba_get_chipid(sc-sc_dev), siba_get_revid(sc-sc_dev),
mac-mac_phy.analog, mac-mac_phy.type, mac-mac_phy.rev,
mac-mac_phy.rf_manuf, mac-mac_phy.rf_ver,
mac-mac_phy.rf_rev);
@@ -1065,8 +1058,6 @@ bwn_attach_post(struct bwn_softc *sc)
 {
struct ieee80211com *ic;
struct ifnet *ifp = sc-sc_ifp;
-   struct 

svn commit: r204923 - in head/sys/dev: bwn siba

2010-03-09 Thread Weongyo Jeong
Author: weongyo
Date: Tue Mar  9 20:07:41 2010
New Revision: 204923
URL: http://svn.freebsd.org/changeset/base/204923

Log:
  uses KOBJMETHOD_END macro to indicate the end of method table.
  
  Submitted by: yongari

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/siba/siba.c
  head/sys/dev/siba/siba_bwn.c
  head/sys/dev/siba/siba_cc.c
  head/sys/dev/siba/siba_pcib.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Mar  9 19:58:00 2010(r204922)
+++ head/sys/dev/bwn/if_bwn.c   Tue Mar  9 20:07:41 2010(r204923)
@@ -14270,7 +14270,7 @@ static device_method_t bwn_methods[] = {
DEVMETHOD(device_detach,bwn_detach),
DEVMETHOD(device_suspend,   bwn_suspend),
DEVMETHOD(device_resume,bwn_resume),
-   { 0,0 }
+   KOBJMETHOD_END
 };
 static driver_t bwn_driver = {
bwn,

Modified: head/sys/dev/siba/siba.c
==
--- head/sys/dev/siba/siba.cTue Mar  9 19:58:00 2010(r204922)
+++ head/sys/dev/siba/siba.cTue Mar  9 20:07:41 2010(r204923)
@@ -632,7 +632,7 @@ static device_method_t siba_methods[] = 
DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
DEVMETHOD(bus_write_ivar,   siba_write_ivar),
 
-   {0, 0},
+   KOBJMETHOD_END
 };
 
 static driver_t siba_driver = {

Modified: head/sys/dev/siba/siba_bwn.c
==
--- head/sys/dev/siba/siba_bwn.cTue Mar  9 19:58:00 2010
(r204922)
+++ head/sys/dev/siba/siba_bwn.cTue Mar  9 20:07:41 2010
(r204923)
@@ -409,7 +409,7 @@ static device_method_t siba_bwn_methods[
DEVMETHOD(pci_release_msi,  siba_bwn_release_msi),
DEVMETHOD(pci_msi_count,siba_bwn_msi_count),
 
-   { 0,0 }
+   KOBJMETHOD_END
 };
 static driver_t siba_bwn_driver = {
siba_bwn,

Modified: head/sys/dev/siba/siba_cc.c
==
--- head/sys/dev/siba/siba_cc.c Tue Mar  9 19:58:00 2010(r204922)
+++ head/sys/dev/siba/siba_cc.c Tue Mar  9 20:07:41 2010(r204923)
@@ -141,7 +141,7 @@ static device_method_t siba_cc_methods[]
DEVMETHOD(device_attach,siba_cc_attach),
DEVMETHOD(device_probe, siba_cc_probe),
 
-   {0, 0},
+   KOBJMETHOD_END
 };
 
 static driver_t siba_cc_driver = {

Modified: head/sys/dev/siba/siba_pcib.c
==
--- head/sys/dev/siba/siba_pcib.c   Tue Mar  9 19:58:00 2010
(r204922)
+++ head/sys/dev/siba/siba_pcib.c   Tue Mar  9 20:07:41 2010
(r204923)
@@ -419,7 +419,7 @@ static device_method_t siba_pcib_methods
DEVMETHOD(pcib_write_config,siba_pcib_write_config),
DEVMETHOD(pcib_route_interrupt, siba_pcib_route_interrupt),
 
-   {0, 0},
+   KOBJMETHOD_END
 };
 
 static driver_t siba_pcib_driver = {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r204326 - head/sys/modules

2010-03-04 Thread Weongyo Jeong
On Thu, Feb 25, 2010 at 10:51:33PM +0300, Ruslan Mahmatkhanov wrote:
 On 25.02.2010 22:42, Weongyo Jeong wrote:
 Author: weongyo
 Date: Thu Feb 25 19:42:51 2010
 New Revision: 204326
 URL: http://svn.freebsd.org/changeset/base/204326
 
 Log:
Add bwn(4) driver to the build.
 
 Thank you much for this!
 When you plan to MFC that?

I think MFC could be happen soon.  Thank you :-)

regards,
Weongyo Jeong

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204657 - in head/sys/dev: bwn siba

2010-03-03 Thread Weongyo Jeong
Author: weongyo
Date: Wed Mar  3 20:06:09 2010
New Revision: 204657
URL: http://svn.freebsd.org/changeset/base/204657

Log:
  fixes an attached-at-boot issue that bwn(4) using device_identify
  interface didn't be attached automatically at boot time so changes a
  approach to attach children based on leveraging some newbus niceties.
  
  Submitted by: nwhitehorn

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/siba/siba_bwn.c
  head/sys/dev/siba/siba_core.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Wed Mar  3 20:01:31 2010(r204656)
+++ head/sys/dev/bwn/if_bwn.c   Wed Mar  3 20:06:09 2010(r204657)
@@ -14312,16 +14312,8 @@ bwn_sysctl_node(struct bwn_softc *sc)
 #endif
 }
 
-static void
-bwn_identify(driver_t *driver, device_t parent)
-{
-
-   BUS_ADD_CHILD(parent, 0, bwn, -1);
-}
-
 static device_method_t bwn_methods[] = {
/* Device interface */
-   DEVMETHOD(device_identify,  bwn_identify),
DEVMETHOD(device_probe, bwn_probe),
DEVMETHOD(device_attach,bwn_attach),
DEVMETHOD(device_detach,bwn_detach),

Modified: head/sys/dev/siba/siba_bwn.c
==
--- head/sys/dev/siba/siba_bwn.cWed Mar  3 20:01:31 2010
(r204656)
+++ head/sys/dev/siba/siba_bwn.cWed Mar  3 20:06:09 2010
(r204657)
@@ -97,8 +97,6 @@ static const struct siba_dev {
{ PCI_VENDOR_BROADCOM, 0x432b, Unknown }
 };
 
-device_t   siba_add_child(device_t, struct siba_softc *, int, const char *,
-   int);
 intsiba_core_attach(struct siba_softc *);
 intsiba_core_detach(struct siba_softc *);
 intsiba_core_suspend(struct siba_softc *);
@@ -238,15 +236,6 @@ siba_bwn_resume(device_t dev)
return (0);
 }
 
-static device_t
-siba_bwn_add_child(device_t dev, int order, const char *name, int unit)
-{
-   struct siba_bwn_softc *ssc = device_get_softc(dev);
-   struct siba_softc *siba = ssc-ssc_siba;
-
-   return (siba_add_child(dev, siba, order, name, unit));
-}
-
 /* proxying to the parent */
 static struct resource *
 siba_bwn_alloc_resource(device_t dev, device_t child, int type, int *rid,
@@ -342,7 +331,6 @@ static device_method_t siba_bwn_methods[
DEVMETHOD(device_resume,siba_bwn_resume),
 
/* Bus interface */
-   DEVMETHOD(bus_add_child,siba_bwn_add_child),
DEVMETHOD(bus_alloc_resource,   siba_bwn_alloc_resource),
DEVMETHOD(bus_release_resource, siba_bwn_release_resource),
DEVMETHOD(bus_setup_intr,   siba_bwn_setup_intr),

Modified: head/sys/dev/siba/siba_core.c
==
--- head/sys/dev/siba/siba_core.c   Wed Mar  3 20:01:31 2010
(r204656)
+++ head/sys/dev/siba/siba_core.c   Wed Mar  3 20:06:09 2010
(r204657)
@@ -133,8 +133,6 @@ static void siba_pci_write_multi_4(struc
size_t, uint16_t);
 static const char *siba_core_name(uint16_t);
 static voidsiba_pcicore_init(struct siba_pci *);
-device_t   siba_add_child(device_t, struct siba_softc *, int, const char *,
-   int);
 intsiba_core_attach(struct siba_softc *);
 intsiba_core_detach(struct siba_softc *);
 intsiba_core_suspend(struct siba_softc *);
@@ -206,8 +204,10 @@ siba_core_attach(struct siba_softc *siba
return (error);
}
 
+   siba_pcicore_init(siba-siba_pci);
siba_powerdown(siba);
-   return (0);
+   
+   return (bus_generic_attach(siba-siba_dev));
 }
 
 int
@@ -277,6 +277,7 @@ siba_scan(struct siba_softc *siba)
 {
struct siba_dev_softc *sd;
uint32_t idhi, tmp;
+   device_t child;
int base, dev_i = 0, error, i, is_pcie, n_80211 = 0, n_cc = 0,
n_pci = 0;
 
@@ -387,6 +388,14 @@ siba_scan(struct siba_softc *siba)
break;
}
dev_i++;
+
+   child = device_add_child(siba-siba_dev, NULL, -1);
+   if (child == NULL) {
+   device_printf(siba-siba_dev, child attach failed\n);
+   continue;
+   }
+
+   device_set_ivars(child, sd);
}
siba-siba_ndevs = dev_i;
 }
@@ -1964,52 +1973,6 @@ siba_barrier(struct siba_dev_softc *sd, 
SIBA_BARRIER(siba, flags);
 }
 
-/*
- * Attach it as child.
- */
-device_t
-siba_add_child(device_t dev, struct siba_softc *siba, int order,
-const char *name, int unit)
-{
-   struct siba_dev_softc *sd;
-   device_t child;
-   int idx = 0, i;
-
-   child = device_add_child(dev, name, unit);
-   if (child == NULL)
-   return (NULL);
-
-   siba_powerup(siba, 0);
-   siba_pcicore_init(siba-siba_pci);

svn commit: r204669 - head/sys/conf

2010-03-03 Thread Weongyo Jeong
Author: weongyo
Date: Wed Mar  3 21:40:44 2010
New Revision: 204669
URL: http://svn.freebsd.org/changeset/base/204669

Log:
  Adds bwn(4) to NOTES.

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Mar  3 21:39:49 2010(r204668)
+++ head/sys/conf/NOTES Wed Mar  3 21:40:44 2010(r204669)
@@ -1886,6 +1886,7 @@ devicexmphy   # XaQti XMAC II
 #  the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and
 #  the embedded gigE NICs on Dell PowerEdge 2550 servers.
 # bwi: Broadcom BCM430* and BCM431* family of wireless adapters.
+# bwn: Broadcom BCM43xx family of wireless adapters.
 # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn
 # cm:  Arcnet SMC COM90c26 / SMC COM90c56
 #  (and SMC COM90c66 in '56 compatibility mode) adapters.
@@ -2092,6 +2093,7 @@ options   AH_SUPPORT_AR5416   # enable AR54
 #deviceath_ar9280  # AR9280 chips
 device ath_rate_sample # SampleRate tx rate control for ath
 device bwi # Broadcom BCM430* BCM431*
+device bwn # Broadcom BCM43xx
 device ral # Ralink Technology RT2500 wireless NICs.
 
 # Use private jumbo buffers allocated exclusively for the ti(4) driver.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r204657 - in head/sys/dev: bwn siba

2010-03-03 Thread Weongyo Jeong
On Wed, Mar 03, 2010 at 08:06:09PM +, Weongyo Jeong wrote:
 Author: weongyo
 Date: Wed Mar  3 20:06:09 2010
 New Revision: 204657
 URL: http://svn.freebsd.org/changeset/base/204657
 
 Log:
   fixes an attached-at-boot issue that bwn(4) using device_identify
   interface didn't be attached automatically at boot time so changes a
   approach to attach children based on leveraging some newbus niceties.
   
   Submitted by:   nwhitehorn
Reported by:marcus, nwhitehorn

regards,
Weongyo Jeong

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204542 - head/sys/dev/bwn

2010-03-01 Thread Weongyo Jeong
Author: weongyo
Date: Mon Mar  1 23:51:13 2010
New Revision: 204542
URL: http://svn.freebsd.org/changeset/base/204542

Log:
  calculates the integer square root if a positive integer X is larger
  than 256 instead of using sqrt_table.
  
  Reported by:  Joe Marcus Clarke marcus at freebsd dot org

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Mon Mar  1 23:39:43 2010(r204541)
+++ head/sys/dev/bwn/if_bwn.c   Mon Mar  1 23:51:13 2010(r204542)
@@ -12846,7 +12846,6 @@ bwn_phy_lp_clear_deaf(struct bwn_mac *ma
 static unsigned int
 bwn_sqrt(struct bwn_mac *mac, unsigned int x)
 {
-   struct bwn_softc *sc = mac-mac_sc;
/* Table holding (10 * sqrt(x)) for x between 1 and 256. */
static uint8_t sqrt_table[256] = {
10, 14, 17, 20, 22, 24, 26, 28,
@@ -12886,9 +12885,11 @@ bwn_sqrt(struct bwn_mac *mac, unsigned i
if (x == 0)
return (0);
if (x = 256) {
-   device_printf(sc-sc_dev,
-   out of bounds of the square-root table (%d)\n, x);
-   return (16);
+   unsigned int tmp;
+
+   for (tmp = 0; x = (2 * tmp) + 1; x -= (2 * tmp++) + 1)
+   /* do nothing */ ;
+   return (tmp);
}
return (sqrt_table[x - 1] / 10);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204436 - head/sys/dev/bwn

2010-02-27 Thread Weongyo Jeong
Author: weongyo
Date: Sat Feb 27 23:04:29 2010
New Revision: 204436
URL: http://svn.freebsd.org/changeset/base/204436

Log:
  supports the adhoc demo mode that it's tested on modified aircrack-ng
  suite and worked.
  
  Submitted by: Paul B Mahol onemda at gmail dot com

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat Feb 27 21:58:55 2010(r204435)
+++ head/sys/dev/bwn/if_bwn.c   Sat Feb 27 23:04:29 2010(r204436)
@@ -1076,6 +1076,7 @@ bwn_attach_post(struct bwn_softc *sc)
ic-ic_caps =
  IEEE80211_C_STA   /* station mode supported */
| IEEE80211_C_MONITOR   /* monitor mode */
+   | IEEE80211_C_AHDEMO/* adhoc demo mode */
| IEEE80211_C_SHPREAMBLE/* short preamble supported */
| IEEE80211_C_SHSLOT/* short slot time supported */
| IEEE80211_C_WME   /* WME/WMM supported */
@@ -8447,7 +8448,8 @@ bwn_newstate(struct ieee80211vap *vap, e
}
}
 
-   if (vap-iv_opmode == IEEE80211_M_MONITOR) {
+   if (vap-iv_opmode == IEEE80211_M_MONITOR ||
+   vap-iv_opmode == IEEE80211_M_AHDEMO) {
/* XXX nothing to do? */
} else if (nstate == IEEE80211_S_RUN) {
memcpy(sc-sc_bssid, vap-iv_bss-ni_bssid, IEEE80211_ADDR_LEN);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204437 - head/sys/dev/bwn

2010-02-27 Thread Weongyo Jeong
Author: weongyo
Date: Sat Feb 27 23:42:32 2010
New Revision: 204437
URL: http://svn.freebsd.org/changeset/base/204437

Log:
  fixes a bug to load firmware images for LP PHY.  For LP PHY always,
  `lp_' string is contained in its full image names.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat Feb 27 23:04:29 2010(r204436)
+++ head/sys/dev/bwn/if_bwn.c   Sat Feb 27 23:42:32 2010(r204437)
@@ -7789,8 +7789,9 @@ bwn_fw_get(struct bwn_mac *mac, enum bwn
bwn_do_release_fw(bfw);
}
 
-   snprintf(namebuf, sizeof(namebuf), bwn%s_v4_%s,
-   (type == BWN_FWTYPE_OPENSOURCE) ? -open : , name);
+   snprintf(namebuf, sizeof(namebuf), bwn%s_v4_%s%s,
+   (type == BWN_FWTYPE_OPENSOURCE) ? -open : ,
+   (mac-mac_phy.type == BWN_PHYTYPE_LP) ? lp_ : , name);
/* XXX Sleeping on fwload with the non-sleepable locks held */
fw = firmware_get(namebuf);
if (fw == NULL) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204385 - head/sys/dev/bwn

2010-02-26 Thread Weongyo Jeong
Author: weongyo
Date: Sat Feb 27 02:20:38 2010
New Revision: 204385
URL: http://svn.freebsd.org/changeset/base/204385

Log:
  don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
  handled in later.
  
  Reported from:imp, nwhitehorn

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sat Feb 27 01:58:41 2010(r204384)
+++ head/sys/dev/bwn/if_bwn.c   Sat Feb 27 02:20:38 2010(r204385)
@@ -9395,8 +9395,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
device_printf(sc-sc_dev, TODO RX: RX_FLAG_FAILED_FCS_CRC\n);
if (phystat0  (BWN_RX_PHYST0_PLCPHCF | BWN_RX_PHYST0_PLCPFV))
device_printf(sc-sc_dev, TODO RX: RX_FLAG_FAILED_PLCP_CRC\n);
-   if (phystat0  BWN_RX_PHYST0_SHORTPRMBL)
-   device_printf(sc-sc_dev, TODO RX: RX_FLAG_SHORTPRE\n);
if (macstat  BWN_RX_MAC_DECERR)
goto drop;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204326 - head/sys/modules

2010-02-25 Thread Weongyo Jeong
Author: weongyo
Date: Thu Feb 25 19:42:51 2010
New Revision: 204326
URL: http://svn.freebsd.org/changeset/base/204326

Log:
  Add bwn(4) driver to the build.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Feb 25 18:02:52 2010(r204325)
+++ head/sys/modules/Makefile   Thu Feb 25 19:42:51 2010(r204326)
@@ -42,6 +42,7 @@ SUBDIR=   ${_3dfx} \
${_bm} \
bridgestp \
bwi \
+   bwn \
cam \
${_canbepm} \
${_canbus} \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204327 - head/share/man/man4

2010-02-25 Thread Weongyo Jeong
Author: weongyo
Date: Thu Feb 25 19:43:22 2010
New Revision: 204327
URL: http://svn.freebsd.org/changeset/base/204327

Log:
  Connect bwn.4 to the build.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Feb 25 19:42:51 2010
(r204326)
+++ head/share/man/man4/MakefileThu Feb 25 19:43:22 2010
(r204327)
@@ -62,6 +62,7 @@ MAN=  aac.4 \
bridge.4 \
bt.4 \
bwi.4 \
+   bwn.4 \
cardbus.4 \
carp.4 \
cas.4 \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204343 - head/share/man/man4

2010-02-25 Thread Weongyo Jeong
Author: weongyo
Date: Fri Feb 26 00:37:49 2010
New Revision: 204343
URL: http://svn.freebsd.org/changeset/base/204343

Log:
  Updates what firmware module should be used for LP (low power) PHY
  users and bumps date.

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Fri Feb 26 00:12:48 2010(r204342)
+++ head/share/man/man4/bwn.4   Fri Feb 26 00:37:49 2010(r204343)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 15, 2010
+.Dd February 25, 2010
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -69,6 +69,8 @@ The
 port needs to be installed before
 .Xr ifconfig 8
 will work.
+Most cases you need to use bwn_v4_ucode module but if you are a
+LP (low power) PHY user please uses bwn_v4_lp_ucode module.
 .Sh HARDWARE
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204256 - head/sys/dev/bwn

2010-02-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Feb 23 19:44:51 2010
New Revision: 204256
URL: http://svn.freebsd.org/changeset/base/204256

Log:
  fixes a compile error; invalid type argument of '-'.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:37:00 2010(r204255)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:44:51 2010(r204256)
@@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct
 {
uint16_t value;
 
-   KASSERT(mac-mac_phy-type == BWN_PHYTYPE_G,
+   KASSERT(mac-mac_phy.type == BWN_PHYTYPE_G,
(%s:%d: fail, __func__, __LINE__));
 
value = (uint8_t) (ctl-q);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204257 - head/sys/dev/bwn

2010-02-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Feb 23 19:55:54 2010
New Revision: 204257
URL: http://svn.freebsd.org/changeset/base/204257

Log:
  o adds sysctl variables to show device statistics.
  o records RTS success/fail statistics.
  
  Pointed by:   imp

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnvar.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:44:51 2010(r204256)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:55:54 2010(r204257)
@@ -536,6 +536,7 @@ static void bwn_phy_lp_gaintbl_write_r2(
struct bwn_txgain_entry);
 static voidbwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int,
struct bwn_txgain_entry);
+static voidbwn_sysctl_node(struct bwn_softc *);
 
 static struct resource_spec bwn_res_spec_legacy[] = {
{ SYS_RES_IRQ,  0,  RF_ACTIVE | RF_SHAREABLE },
@@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc)
struct ifnet *ifp = sc-sc_ifp;
struct siba_dev_softc *sd = sc-sc_sd;
struct siba_sprom *sprom = sd-sd_bus-siba_sprom;
-#ifdef BWN_DEBUG
-   device_t dev = sc-sc_dev;
-#endif
 
ic = ifp-if_l2com;
ic-ic_ifp = ifp;
@@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc)
sc-sc_rx_th.wr_ihdr, sizeof(sc-sc_rx_th),
BWN_RX_RADIOTAP_PRESENT);
 
-#ifdef BWN_DEBUG
-   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
-   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-   debug, CTLFLAG_RW, sc-sc_debug, 0, Debug flags);
-#endif
+   bwn_sysctl_node(sc);
 
if (bootverbose)
ieee80211_announce(ic);
@@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
struct bwn_pio_txqueue *tq;
struct bwn_pio_txpkt *tp = NULL;
struct bwn_softc *sc = mac-mac_sc;
+   struct bwn_stats *stats = mac-mac_stats;
struct ieee80211_node *ni;
int slot;
 
@@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co
device_printf(sc-sc_dev, TODO: STATUS AMPDU\n);
if (status-rtscnt) {
if (status-rtscnt == 0xf)
-   device_printf(sc-sc_dev, TODO: RTS fail\n);
+   stats-rtsfail++;
else
-   device_printf(sc-sc_dev, TODO: RTS ok\n);
+   stats-rts++;
}
 
if (mac-mac_flags  BWN_MAC_FLAG_DMA) {
@@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_
 }
 
 static void
+bwn_sysctl_node(struct bwn_softc *sc)
+{
+   device_t dev = sc-sc_dev;
+   struct bwn_mac *mac;
+   struct bwn_stats *stats;
+
+   /* XXX assume that count of MAC is only 1. */
+
+   if ((mac = sc-sc_curmac) == NULL)
+   return;
+   stats = mac-mac_stats;
+
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   linknoise, CTLFLAG_RW, stats-rts, 0, Noise level);
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   rts, CTLFLAG_RW, stats-rts, 0, RTS);
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   rtsfail, CTLFLAG_RW, stats-rtsfail, 0, RTS failed to send);
+
+#ifdef BWN_DEBUG
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   debug, CTLFLAG_RW, sc-sc_debug, 0, Debug flags);
+#endif
+}
+
+static void
 bwn_identify(driver_t *driver, device_t parent)
 {
 

Modified: head/sys/dev/bwn/if_bwnvar.h
==
--- head/sys/dev/bwn/if_bwnvar.hTue Feb 23 19:44:51 2010
(r204256)
+++ head/sys/dev/bwn/if_bwnvar.hTue Feb 23 19:55:54 2010
(r204257)
@@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header {
 };
 
 struct bwn_stats {
+   int32_t rtsfail;
+   int32_t rts;
int32_t link_noise;
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204081 - head/sys/dev/bwn

2010-02-18 Thread Weongyo Jeong
Author: weongyo
Date: Fri Feb 19 03:36:02 2010
New Revision: 204081
URL: http://svn.freebsd.org/changeset/base/204081

Log:
  o print msgs with length if the frame is too short to pass to net80211.
  o print key index for debugging if the frame is attempted to decrypt for
WEP, AES or TKIP though currently HW decryption isn't supported.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Fri Feb 19 02:34:25 2010(r204080)
+++ head/sys/dev/bwn/if_bwn.c   Fri Feb 19 03:36:02 2010(r204081)
@@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mb
 
padding = (macstat  BWN_RX_MAC_PADDING) ? 2 : 0;
if (m-m_pkthdr.len  (sizeof(struct bwn_plcp6) + padding)) {
-   device_printf(sc-sc_dev, RX: Packet size underrun (1)\n);
+   device_printf(sc-sc_dev, frame too short (length=%d)\n,
+   m-m_pkthdr.len);
goto drop;
}
plcp = (struct bwn_plcp6 *)(mp + padding);
m_adj(m, sizeof(struct bwn_plcp6) + padding);
if (m-m_pkthdr.len  IEEE80211_MIN_LEN) {
-   device_printf(sc-sc_dev, RX: Packet size underrun (2)\n);
+   device_printf(sc-sc_dev, frame too short (length=%d)\n,
+   m-m_pkthdr.len);
goto drop;
}
wh = mtod(m, struct ieee80211_frame_min *);
 
if (macstat  BWN_RX_MAC_DEC)
-   device_printf(sc-sc_dev, TODO: BWN_RX_MAC_DEC\n);
+   device_printf(sc-sc_dev,
+   RX decryption attempted (old %d keyidx %#x)\n,
+   BWN_ISOLDFMT(mac),
+   (macstat  BWN_RX_MAC_KEYIDX)  BWN_RX_MAC_KEYIDX_SHIFT);
 
/* XXX calculating RSSI  noise  antenna */
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r203944 - head/sys/dev/siba

2010-02-15 Thread Weongyo Jeong
Author: weongyo
Date: Tue Feb 16 01:22:33 2010
New Revision: 203944
URL: http://svn.freebsd.org/changeset/base/203944

Log:
  supports SPROM rev8 informations properly which are used to support
  low-power PHY of bwn(4) and LDO voltage adjustments.

Modified:
  head/sys/dev/siba/siba_core.c
  head/sys/dev/siba/sibareg.h
  head/sys/dev/siba/sibavar.h

Modified: head/sys/dev/siba/siba_core.c
==
--- head/sys/dev/siba/siba_core.c   Tue Feb 16 01:07:06 2010
(r203943)
+++ head/sys/dev/siba/siba_core.c   Tue Feb 16 01:22:33 2010
(r203944)
@@ -1457,6 +1457,9 @@ siba_crc8(uint8_t crc, uint8_t data)
(((__x)  (__mask)) / SIBA_LOWEST_SET_BIT(__mask))
 #defineSIBA_SHIFTOUT(_var, _offset, _mask) 
\
out-_var = SIBA_SHIFTOUT_SUB(in[SIBA_OFFSET(_offset)], (_mask))
+#define SIBA_SHIFTOUT_4(_var, _offset, _mask, _shift)  \
+   out-_var = uint32_t)in[SIBA_OFFSET((_offset)+2)]  16 |   \
+   in[SIBA_OFFSET(_offset)])  (_mask))  (_shift))
 
 static void
 siba_sprom_r123(struct siba_sprom *out, const uint16_t *in)
@@ -1511,6 +1514,7 @@ siba_sprom_r123(struct siba_sprom *out, 
SIBA_SHIFTOUT(gpio1, SIBA_SPROM1_GPIOA, SIBA_SPROM1_GPIOA_P1);
SIBA_SHIFTOUT(gpio2, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P2);
SIBA_SHIFTOUT(gpio3, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P3);
+
SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_A);
SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_BG);
SIBA_SHIFTOUT(tssi_a, SIBA_SPROM1_TSSI, SIBA_SPROM1_TSSI_A);
@@ -1587,22 +1591,61 @@ siba_sprom_r8(struct siba_sprom *out, co
uint16_t v;
 
for (i = 0; i  3; i++) {
-   v = in[SIBA_OFFSET(SIBA_SPROM1_MAC_80211BG) + i];
+   v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i];
*(((uint16_t *)out-mac_80211bg) + i) = htobe16(v);
}
SIBA_SHIFTOUT(ccode, SIBA_SPROM8_CCODE, 0x);
SIBA_SHIFTOUT(bf_lo, SIBA_SPROM8_BFLOW, 0x);
SIBA_SHIFTOUT(bf_hi, SIBA_SPROM8_BFHIGH, 0x);
+   SIBA_SHIFTOUT(bf2_lo, SIBA_SPROM8_BFL2LO, 0x);
+   SIBA_SHIFTOUT(bf2_hi, SIBA_SPROM8_BFL2HI, 0x);
SIBA_SHIFTOUT(ant_a, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_A);
SIBA_SHIFTOUT(ant_bg, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_BG);
SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_MAXP_BG_MASK);
SIBA_SHIFTOUT(tssi_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_TSSI_BG);
SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_MAXP_A_MASK);
SIBA_SHIFTOUT(tssi_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_TSSI_A);
+   SIBA_SHIFTOUT(maxpwr_ah, SIBA_SPROM8_MAXP_AHL,
+   SIBA_SPROM8_MAXP_AH_MASK);
+   SIBA_SHIFTOUT(maxpwr_al, SIBA_SPROM8_MAXP_AHL,
+   SIBA_SPROM8_MAXP_AL_MASK);
SIBA_SHIFTOUT(gpio0, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P0);
SIBA_SHIFTOUT(gpio1, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P1);
SIBA_SHIFTOUT(gpio2, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P2);
SIBA_SHIFTOUT(gpio3, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P3);
+   SIBA_SHIFTOUT(tri2g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI2G);
+   SIBA_SHIFTOUT(tri5g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI5G);
+   SIBA_SHIFTOUT(tri5gl, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GL);
+   SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH);
+   SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G);
+   SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G);
+   SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G);
+   SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G);
+   SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G);
+   SIBA_SHIFTOUT(bxa2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_BXA2G);
+   SIBA_SHIFTOUT(rssismf5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMF5G);
+   SIBA_SHIFTOUT(rssismc5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMC5G);
+   SIBA_SHIFTOUT(rssisav5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISAV5G);
+   SIBA_SHIFTOUT(bxa5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_BXA5G);
+
+   SIBA_SHIFTOUT(pa0b0, SIBA_SPROM8_PA0B0, 0x);
+   SIBA_SHIFTOUT(pa0b1, SIBA_SPROM8_PA0B1, 0x);
+   SIBA_SHIFTOUT(pa0b2, SIBA_SPROM8_PA0B2, 0x);
+   SIBA_SHIFTOUT(pa1b0, SIBA_SPROM8_PA1B0, 0x);
+   SIBA_SHIFTOUT(pa1b1, SIBA_SPROM8_PA1B1, 0x);
+   SIBA_SHIFTOUT(pa1b2, SIBA_SPROM8_PA1B2, 0x);
+   SIBA_SHIFTOUT(pa1lob0, SIBA_SPROM8_PA1LOB0, 0x);
+   SIBA_SHIFTOUT(pa1lob1, SIBA_SPROM8_PA1LOB1, 0x);
+   SIBA_SHIFTOUT(pa1lob2, SIBA_SPROM8_PA1LOB2, 0x);
+   SIBA_SHIFTOUT(pa1hib0, SIBA_SPROM8_PA1HIB0, 0x);
+   SIBA_SHIFTOUT(pa1hib1, SIBA_SPROM8_PA1HIB1, 0x);
+   SIBA_SHIFTOUT(pa1hib2, SIBA_SPROM8_PA1HIB2, 

svn commit: r203945 - in head: share/man/man4 sys/dev/bwn sys/modules/bwn

2010-02-15 Thread Weongyo Jeong
 cardbus 4 ,
+.Xr intro 4 ,
+.Xr pci 4 ,
+.Xr wlan 4 ,
+.Xr wlan_amrr 4 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Weongyo Jeong
+.Aq weon...@freebsd.org .
+.\.Sh BUGS
+.\Some card based on the BCM4306 and BCM4309 chips do not work properly
+.\on channel 1, 2 and 3.

Added: head/sys/dev/bwn/if_bwn.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 16 01:44:14 2010(r203945)
@@ -0,0 +1,14317 @@
+/*-
+ * Copyright (c) 2009-2010 Weongyo Jeong weon...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the NO WARRANTY disclaimer below (Disclaimer) and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+/*
+ * The Broadcom Wireless LAN controller driver.
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/module.h
+#include sys/kernel.h
+#include sys/endian.h
+#include sys/errno.h
+#include sys/firmware.h
+#include sys/lock.h
+#include sys/mutex.h
+#include machine/bus.h
+#include machine/resource.h
+#include sys/bus.h
+#include sys/rman.h
+#include sys/socket.h
+#include sys/sockio.h
+
+#include net/ethernet.h
+#include net/if.h
+#include net/if_arp.h
+#include net/if_dl.h
+#include net/if_llc.h
+#include net/if_media.h
+#include net/if_types.h
+
+#include dev/pci/pcivar.h
+#include dev/pci/pcireg.h
+#include dev/siba/siba_ids.h
+#include dev/siba/sibareg.h
+#include dev/siba/sibavar.h
+
+#include net80211/ieee80211_var.h
+#include net80211/ieee80211_radiotap.h
+#include net80211/ieee80211_regdomain.h
+#include net80211/ieee80211_amrr.h
+#include net80211/ieee80211_phy.h
+
+#include dev/bwn/if_bwnreg.h
+#include dev/bwn/if_bwnvar.h
+
+SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, Broadcom driver parameters);
+
+/*
+ * Tunable  sysctl variables.
+ */
+
+#ifdef BWN_DEBUG
+static int bwn_debug = 0;
+SYSCTL_INT(_hw_bwn, OID_AUTO, debug, CTLFLAG_RW, bwn_debug, 0,
+Broadcom debugging printfs);
+TUNABLE_INT(hw.bwn.debug, bwn_debug);
+enum {
+   BWN_DEBUG_XMIT  = 0x0001,   /* basic xmit operation */
+   BWN_DEBUG_RECV  = 0x0002,   /* basic recv operation */
+   BWN_DEBUG_STATE = 0x0004,   /* 802.11 state transitions */
+   BWN_DEBUG_TXPOW = 0x0008,   /* tx power processing */
+   BWN_DEBUG_RESET = 0x0010,   /* reset processing */
+   BWN_DEBUG_OPS   = 0x0020,   /* bwn_ops processing */
+   BWN_DEBUG_BEACON= 0x0040,   /* beacon handling */
+   BWN_DEBUG_WATCHDOG  = 0x0080,   /* watchdog timeout */
+   BWN_DEBUG_INTR  = 0x0100,   /* ISR */
+   BWN_DEBUG_CALIBRATE = 0x0200,   /* periodic calibration */
+   BWN_DEBUG_NODE  = 0x0400,   /* node management */
+   BWN_DEBUG_LED   = 0x0800,   /* led management */
+   BWN_DEBUG_CMD   = 0x1000,   /* cmd submission */
+   BWN_DEBUG_LO= 0x2000,   /* LO */
+   BWN_DEBUG_FW= 0x4000,   /* firmware */
+   BWN_DEBUG_WME   = 0x8000,   /* WME */
+   BWN_DEBUG_RF= 0x0001,   /* RF */
+   BWN_DEBUG_FATAL = 0x8000,   /* fatal errors */
+   BWN_DEBUG_ANY   = 0x
+};
+#defineDPRINTF(sc, m, fmt, ...) do {   \
+   if (sc-sc_debug  (m)) \
+   printf(fmt, __VA_ARGS__);   \
+} while (0)
+#else

svn commit: r203320 - head/sys/modules

2010-01-31 Thread Weongyo Jeong
Author: weongyo
Date: Sun Jan 31 21:22:45 2010
New Revision: 203320
URL: http://svn.freebsd.org/changeset/base/203320

Log:
  Hook up the siba_bwn module to the build.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Jan 31 21:18:22 2010(r203319)
+++ head/sys/modules/Makefile   Sun Jan 31 21:22:45 2010(r203320)
@@ -249,6 +249,7 @@ SUBDIR= ${_3dfx} \
sdhci \
sem \
sf \
+   siba_bwn \
siis \
sis \
sk \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r203087 - head/sys/dev/usb/wlan

2010-01-27 Thread Weongyo Jeong
Author: weongyo
Date: Wed Jan 27 19:43:14 2010
New Revision: 203087
URL: http://svn.freebsd.org/changeset/base/203087

Log:
  adds sysctl knobs to show rate statistics that it could be useful to
  debug slow TX speed.

Modified:
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_urtwvar.h

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Wed Jan 27 19:30:44 2010
(r203086)
+++ head/sys/dev/usb/wlan/if_urtw.c Wed Jan 27 19:43:14 2010
(r203087)
@@ -762,6 +762,7 @@ static int  urtw_compute_txtime(uint16_t
uint8_t);
 static voidurtw_updateslot(struct ifnet *);
 static voidurtw_updateslottask(void *, int);
+static voidurtw_sysctl_node(struct urtw_softc *);
 
 static int
 urtw_match(device_t dev)
@@ -906,6 +907,8 @@ urtw_attach(device_t dev)
sc-sc_rxtap.wr_ihdr, sizeof(sc-sc_rxtap),
URTW_RX_RADIOTAP_PRESENT);
 
+   urtw_sysctl_node(sc);
+
if (bootverbose)
ieee80211_announce(ic);
return (0);
@@ -1703,6 +1706,8 @@ urtw_tx_start(struct urtw_softc *sc, str
rate = urtw_rtl2rate(sc-sc_currate);
}
 
+   sc-sc_stats.txrates[sc-sc_currate]++;
+
if (IEEE80211_IS_MULTICAST(wh-i_addr1))
txdur = pkttime = urtw_compute_txtime(m0-m_pkthdr.len +
IEEE80211_CRC_LEN, rate, 0, 0);
@@ -4372,6 +4377,54 @@ fail:
URTW_UNLOCK(sc);
 }
 
+static void
+urtw_sysctl_node(struct urtw_softc *sc)
+{
+#defineURTW_SYSCTL_STAT_ADD32(c, h, n, p, d)   \
+   SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
+   struct sysctl_ctx_list *ctx;
+   struct sysctl_oid_list *child, *parent;
+   struct sysctl_oid *tree;
+   struct urtw_stats *stats = sc-sc_stats;
+
+   ctx = device_get_sysctl_ctx(sc-sc_dev);
+   child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc-sc_dev));
+
+   tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, stats, CTLFLAG_RD,
+   NULL, URTW statistics);
+   parent = SYSCTL_CHILDREN(tree);
+
+   /* Tx statistics. */
+   tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, tx, CTLFLAG_RD,
+   NULL, Tx MAC statistics);
+   child = SYSCTL_CHILDREN(tree);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 1m, stats-txrates[0],
+   1 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 2m, stats-txrates[1],
+   2 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 5.5m, stats-txrates[2],
+   5.5 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 6m, stats-txrates[4],
+   6 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 9m, stats-txrates[5],
+   9 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 11m, stats-txrates[3],
+   11 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 12m, stats-txrates[6],
+   12 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 18m, stats-txrates[7],
+   18 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 24m, stats-txrates[8],
+   24 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 36m, stats-txrates[9],
+   36 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 48m, stats-txrates[10],
+   48 Mbit/s);
+   URTW_SYSCTL_STAT_ADD32(ctx, child, 54m, stats-txrates[11],
+   54 Mbit/s);
+#undef URTW_SYSCTL_STAT_ADD32
+}
+
 static device_method_t urtw_methods[] = {
DEVMETHOD(device_probe, urtw_match),
DEVMETHOD(device_attach, urtw_attach),

Modified: head/sys/dev/usb/wlan/if_urtwvar.h
==
--- head/sys/dev/usb/wlan/if_urtwvar.h  Wed Jan 27 19:30:44 2010
(r203086)
+++ head/sys/dev/usb/wlan/if_urtwvar.h  Wed Jan 27 19:43:14 2010
(r203087)
@@ -81,6 +81,10 @@ struct urtw_tx_radiotap_header {
((1  IEEE80211_RADIOTAP_FLAGS) |  \
 (1  IEEE80211_RADIOTAP_CHANNEL))
 
+struct urtw_stats {
+   unsigned inttxrates[12];
+};
+
 struct urtw_vap {
struct ieee80211vap vap;
int (*newstate)(struct ieee80211vap *,
@@ -169,6 +173,8 @@ struct urtw_softc {
uint64_tsc_txstatus;/* only for 8187B */
struct task sc_updateslot_task;
 
+   struct urtw_stats   sc_stats;
+
struct  urtw_rx_radiotap_header sc_rxtap;
int sc_rxtap_len;
struct  urtw_tx_radiotap_header sc_txtap;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r202608 - in head/sys/dev/usb: . wlan

2010-01-18 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jan 19 01:11:27 2010
New Revision: 202608
URL: http://svn.freebsd.org/changeset/base/202608

Log:
  removes a hack to attach TRENDnet TEW-504UB/EU that I think this issue
  is solved with r202607.  Now idProduct of all uath(4) devices should be
  decreased after loading the firmware.

Modified:
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_uath.c

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Jan 19 01:04:44 2010(r202607)
+++ head/sys/dev/usb/usbdevsTue Jan 19 01:11:27 2010(r202608)
@@ -2778,7 +2778,6 @@ product UMEDIA TEW429UBC1 0x300d  TEW-429
 product UMEDIA ALL0298V2   0x3204  ALL0298 v2
 product UMEDIA AR5523_20x3205  AR5523
 product UMEDIA AR5523_2_NF 0x3206  AR5523 (no firmware)
-product UMEDIA AR5523_30x3207  AR5523
 
 /* Universal Access products */
 product UNIACCESS PANACHE  0x0101  Panache Surf USB ISDN Adapter

Modified: head/sys/dev/usb/wlan/if_uath.c
==
--- head/sys/dev/usb/wlan/if_uath.c Tue Jan 19 01:04:44 2010
(r202607)
+++ head/sys/dev/usb/wlan/if_uath.c Tue Jan 19 01:11:27 2010
(r202608)
@@ -190,7 +190,6 @@ static const struct usb_device_id uath_d
UATH_DEV(NETGEAR3,  WPN111),
UATH_DEV(UMEDIA,TEW444UBEU),
UATH_DEV(UMEDIA,AR5523_2),
-   UATH_DEV(UMEDIA,AR5523_3),
UATH_DEV(WISTRONNEWEB,  AR5523_1),
UATH_DEV(WISTRONNEWEB,  AR5523_2),
UATH_DEV(ZCOM,  AR5523)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r202609 - head/sys/dev/usb

2010-01-18 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jan 19 01:26:40 2010
New Revision: 202609
URL: http://svn.freebsd.org/changeset/base/202609

Log:
  Product ID of D-Link DWA-120 after loading the firmware is incorrect.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Jan 19 01:11:27 2010(r202608)
+++ head/sys/dev/usb/usbdevsTue Jan 19 01:26:40 2010(r202609)
@@ -1236,8 +1236,8 @@ product DLINK DSB650TX_PNA0x4003  1/10/1
 product DLINK DSB650TX30x400b  10/100 Ethernet
 product DLINK DSB650TX20x4102  10/100 Ethernet
 product DLINK DSB650   0xabc1  10/100 Ethernet
+product DLINK2 DWA120  0x3a0c  DWA-120
 product DLINK2 DWA120_NF   0x3a0d  DWA-120 (no firmware)
-product DLINK2 DWA120  0x3a0e  DWA-120
 product DLINK2 DWLG122C1   0x3c03  DWL-G122 c1
 product DLINK2 WUA1340 0x3c04  WUA-1340
 product DLINK2 DWA111  0x3c06  DWA-111
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r202610 - head/etc/devd

2010-01-18 Thread Weongyo Jeong
Author: weongyo
Date: Tue Jan 19 01:33:56 2010
New Revision: 202610
URL: http://svn.freebsd.org/changeset/base/202610

Log:
  adds a hardware specific configuration file for uath(4).
  
  Pointed by:   sam
  Reviewed by:  imp, thompsa

Added:
  head/etc/devd/uath.conf   (contents, props changed)
Modified:
  head/etc/devd/Makefile

Modified: head/etc/devd/Makefile
==
--- head/etc/devd/Makefile  Tue Jan 19 01:26:40 2010(r202609)
+++ head/etc/devd/Makefile  Tue Jan 19 01:33:56 2010(r202610)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FILES= asus.conf
+FILES= asus.conf uath.conf
 
 NO_OBJ=
 FILESDIR=  /etc/devd

Added: head/etc/devd/uath.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/devd/uath.conf Tue Jan 19 01:33:56 2010(r202610)
@@ -0,0 +1,120 @@
+# $FreeBSD$
+#
+# Atheros USB wireless network device specific devd events
+
+# Accton
+#   SMCWUSB-G and SMCWUSBT-G2
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x083a;
+   match product (0x4505|0x4507);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Atheros Communications
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x168c;
+   match product 0x0002;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Atheros Communications
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0cf3;
+   match product (0x0002|0x0004|0x0006);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Conceptronic
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0d8e;
+   match product (0x7802|0x7812);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# D-Link
+#   DWL-AG132, DWL-G132 and DWL-AG122
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x2001;
+   match product (0x3a01|0x3a03|0x3a05);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# D-Link
+#  DWA-120
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x07d1;
+   match product 0x3a0c;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Gigaset
+#   SMCWUSBT-G
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1690;
+   match product (0x0711|0x0713);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Global Sun Technology
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x16ab;
+   match product (0x7802|0x7812);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# BayNETGEAR
+#   WG111U
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0846;
+   match product 0x4301;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Netgear
+#   WG111T and WPN111
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1385;
+   match product (0x4251|0x5f01);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# U-MEDIA Communications
+#   TEW-444UB and AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x157e;
+   match product (0x3007|0x3206);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Wistron NeWeb
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x1435;
+   match product (0x0827|0x0829);
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
+
+# Z-Com
+#   AR5523
+attach 100 {
+   device-name ugen[0-9.]+;
+   match vendor 0x0cde;
+   match product 0x0013;
+   action /usr/sbin/uathload -d /dev/$device-name;
+};
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198862 - head/sys/dev/usb/wlan

2009-11-03 Thread Weongyo Jeong
Author: weongyo
Date: Tue Nov  3 21:47:07 2009
New Revision: 198862
URL: http://svn.freebsd.org/changeset/base/198862

Log:
  fixes a typo that value should be 0 not 10.

Modified:
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Tue Nov  3 21:24:37 2009
(r198861)
+++ head/sys/dev/usb/wlan/if_urtw.c Tue Nov  3 21:47:07 2009
(r198862)
@@ -1688,7 +1688,7 @@ urtw_tx_start(struct urtw_softc *sc, str
ieee80211_radiotap_tx(vap, m0);
}
 
-   if ((wh-i_fc[10]  IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT 
||
+   if ((wh-i_fc[0]  IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
(wh-i_fc[0]  IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) {
tp = vap-iv_txparms[ieee80211_chan2mode(ic-ic_curchan)];
rate = tp-mgmtrate;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/wlan dev/xen/xenpci

2009-10-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Oct 20 17:50:36 2009
New Revision: 198300
URL: http://svn.freebsd.org/changeset/base/198300

Log:
  MFC r198098:
fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.
  
Tested by:  bsduser bsd at acd.homelinux.org
  
  MFC r198099:
fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.
  
  Approved by:  re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/usb/wlan/if_rum.c
  stable/8/sys/dev/usb/wlan/if_uath.c
  stable/8/sys/dev/usb/wlan/if_upgt.c
  stable/8/sys/dev/usb/wlan/if_ural.c
  stable/8/sys/dev/usb/wlan/if_urtw.c
  stable/8/sys/dev/usb/wlan/if_zyd.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==
--- stable/8/sys/dev/usb/wlan/if_rum.c  Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_rum.c  Tue Oct 20 17:50:36 2009
(r198300)
@@ -826,6 +826,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RUM_UNLOCK(sc);
+   rum_start(ifp);
+   RUM_LOCK(sc);
break;
 
default:/* Error */
@@ -930,8 +933,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RUM_UNLOCK(sc);
if (m) {
-   RUM_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -941,8 +944,11 @@ tr_setup:
} else
(void) ieee80211_input_all(ic, m, rssi,
RT2573_NOISE_FLOOR);
-   RUM_LOCK(sc);
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   rum_start(ifp);
+   RUM_LOCK(sc);
return;
 
default:/* Error */

Modified: stable/8/sys/dev/usb/wlan/if_uath.c
==
--- stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -2762,6 +2762,9 @@ setup:
m = NULL;
desc = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   uath_start(ifp);
UATH_LOCK(sc);
break;
default:

Modified: stable/8/sys/dev/usb/wlan/if_upgt.c
==
--- stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -2293,6 +2293,9 @@ setup:
(void) ieee80211_input_all(ic, m, rssi, nf);
m = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   upgt_start(ifp);
UPGT_LOCK(sc);
break;
default:

Modified: stable/8/sys/dev/usb/wlan/if_ural.c
==
--- stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -837,6 +837,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RAL_UNLOCK(sc);
+   ural_start(ifp);
+   RAL_LOCK(sc);
break;
 
default:/* Error */
@@ -945,8 +948,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RAL_UNLOCK(sc);
if (m) {
-   RAL_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -954,8 +957,11 @@ tr_setup:
ieee80211_free_node(ni);

svn commit: r198194 - head/sys/dev/usb/wlan

2009-10-17 Thread Weongyo Jeong
Author: weongyo
Date: Sun Oct 18 00:11:49 2009
New Revision: 198194
URL: http://svn.freebsd.org/changeset/base/198194

Log:
  overhauls urtw(4) for supporting RTL8187B devices properly that there
  was major changes to initialize RF chipset and set H/W registers and
  removed a lot of magic numbers on code.  Details are as follows:
  
- uses the endpoint 0x89 to get TX status information which used to
  get TX complete or retry numbers or get a beacon interrupt.  It's
  only valuable for RTL8187B.
- removes urtw_write[8|16|32]_i functions that it's useless now.
- uses ic-ic_updateslot to set SLOT, SIFS, DIES, EIFS, CW_VAL
  registers that doesn't set these whenever the channel is changed.
- code for initializing RF chipset for RTL8187B changed a lot that
  there was many problems on TX transfers so it doesn't work properly
  even if just for a ping/pong.  Now it becomes more stable than
  before that TX throughputs using netperf(1) were about 15 ~ 17Mbps/s
  though sometimes it encounters packet losses.
- removes a lot of magic numbers that in the previous all of
  representing RX and TX descriptors were consisted of magic numbers
  and structures.  It'd be more readable rather than before.
- calculates TX duration more accurately for urtw(4) devices.
- style(9)

Modified:
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_urtwreg.h
  head/sys/dev/usb/wlan/if_urtwvar.h

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Sat Oct 17 23:04:04 2009
(r198193)
+++ head/sys/dev/usb/wlan/if_urtw.c Sun Oct 18 00:11:49 2009
(r198194)
@@ -76,6 +76,7 @@ enum {
URTW_DEBUG_STATE= 0x0020,   /* 802.11 state transitions */
URTW_DEBUG_STAT = 0x0040,   /* statistic */
URTW_DEBUG_INIT = 0x0080,   /* initialization of dev */
+   URTW_DEBUG_TXSTATUS = 0x0100,   /* tx status */
URTW_DEBUG_ANY  = 0x
 };
 #defineDPRINTF(sc, m, fmt, ...) do {   \
@@ -326,13 +327,47 @@ static struct urtw_pair urtw_8225v2_rf_p
{ 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 }
 };
 
-static struct urtw_pair urtw_8225v2b_rf_part1[] = {
+static struct urtw_pair urtw_8225v2b_rf_part0[] = {
{ 0x00, 0x00b7 }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 },
{ 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a },
{ 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb },
{ 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 }
 };
 
+static struct urtw_pair urtw_8225v2b_rf_part1[] = {
+   {0x0f0, 0x32}, {0x0f1, 0x32}, {0x0f2, 0x00},
+   {0x0f3, 0x00}, {0x0f4, 0x32}, {0x0f5, 0x43},
+   {0x0f6, 0x00}, {0x0f7, 0x00}, {0x0f8, 0x46},
+   {0x0f9, 0xa4}, {0x0fa, 0x00}, {0x0fb, 0x00},
+   {0x0fc, 0x96}, {0x0fd, 0xa4}, {0x0fe, 0x00},
+   {0x0ff, 0x00}, {0x158, 0x4b}, {0x159, 0x00},
+   {0x15a, 0x4b}, {0x15b, 0x00}, {0x160, 0x4b},
+   {0x161, 0x09}, {0x162, 0x4b}, {0x163, 0x09},
+   {0x1ce, 0x0f}, {0x1cf, 0x00}, {0x1e0, 0xff},
+   {0x1e1, 0x0f}, {0x1e2, 0x00}, {0x1f0, 0x4e},
+   {0x1f1, 0x01}, {0x1f2, 0x02}, {0x1f3, 0x03},
+   {0x1f4, 0x04}, {0x1f5, 0x05}, {0x1f6, 0x06},
+   {0x1f7, 0x07}, {0x1f8, 0x08}, {0x24e, 0x00},
+   {0x20c, 0x04}, {0x221, 0x61}, {0x222, 0x68},
+   {0x223, 0x6f}, {0x224, 0x76}, {0x225, 0x7d},
+   {0x226, 0x84}, {0x227, 0x8d}, {0x24d, 0x08},
+   {0x250, 0x05}, {0x251, 0xf5}, {0x252, 0x04},
+   {0x253, 0xa0}, {0x254, 0x1f}, {0x255, 0x23},
+   {0x256, 0x45}, {0x257, 0x67}, {0x258, 0x08},
+   {0x259, 0x08}, {0x25a, 0x08}, {0x25b, 0x08},
+   {0x260, 0x08}, {0x261, 0x08}, {0x262, 0x08},
+   {0x263, 0x08}, {0x264, 0xcf}, {0x272, 0x56},
+   {0x273, 0x9a}, {0x034, 0xf0}, {0x035, 0x0f},
+   {0x05b, 0x40}, {0x084, 0x88}, {0x085, 0x24},
+   {0x088, 0x54}, {0x08b, 0xb8}, {0x08c, 0x07},
+   {0x08d, 0x00}, {0x094, 0x1b}, {0x095, 0x12},
+   {0x096, 0x00}, {0x097, 0x06}, {0x09d, 0x1a},
+   {0x09f, 0x10}, {0x0b4, 0x22}, {0x0be, 0x80},
+   {0x0db, 0x00}, {0x0ee, 0x00}, {0x091, 0x03},
+   {0x24c, 0x00}, {0x39f, 0x00}, {0x08c, 0x01},
+   {0x08d, 0x10}, {0x08e, 0x08}, {0x08f, 0x00}
+};
+
 static struct urtw_pair urtw_8225v2_rf_part2[] = {
{ 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 },
{ 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 },
@@ -478,6 +513,7 @@ static const uint8_t urtw_8187b_reg_tabl
 
 static usb_callback_t urtw_bulk_rx_callback;
 static usb_callback_t urtw_bulk_tx_callback;
+static usb_callback_t urtw_bulk_tx_status_callback;
 
 static const struct usb_config urtw_8187b_usbconfig[URTW_8187B_N_XFERS] = {
[URTW_8187B_BULK_RX] = {
@@ -492,6 +528,18 

svn commit: r198195 - head/share/man/man4

2009-10-17 Thread Weongyo Jeong
Author: weongyo
Date: Sun Oct 18 00:46:59 2009
New Revision: 198195
URL: http://svn.freebsd.org/changeset/base/198195

Log:
  adds devices supportted by urtw(4) and bumps date.

Modified:
  head/share/man/man4/urtw.4

Modified: head/share/man/man4/urtw.4
==
--- head/share/man/man4/urtw.4  Sun Oct 18 00:11:49 2009(r198194)
+++ head/share/man/man4/urtw.4  Sun Oct 18 00:46:59 2009(r198195)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 2, 2009
+.Dd October 17, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
@@ -70,9 +70,15 @@ driver supports Realtek RTL8187B/L based
 .Pp
 .Bl -column Shuttle XPC Accessory PN20 RTL8225 USB -compact -offset 6n
 .It Em Card   Radio   Bus
+.It Belkin F5D7050E   RTL8225 USB
+.It Linksys WUSB54GCv2RTL8225 USB
 .It Netgear WG111v2   RTL8225 USB
+.It Netgear WG111v3   RTL8225 USB
 .It Safehome WLG-1500SMA5 RTL8225 USB
 .It Shuttle XPC Accessory PN20RTL8225 USB
+.It Sitecom WL168v1   RTL8225 USB
+.It Sitecom WL168v4   RTL8225 USB
+.It SureCom EP-9001-g(2A) RTL8225 USB
 .It TRENDnet TEW-424UB V3.xR  RTL8225 USB
 .El
 .Sh EXAMPLES
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198098 - head/sys/dev/usb/wlan

2009-10-14 Thread Weongyo Jeong
Author: weongyo
Date: Wed Oct 14 20:09:09 2009
New Revision: 198098
URL: http://svn.freebsd.org/changeset/base/198098

Log:
  fixes a TX hang bug that it could happen when if_start callback didn't
  be restarted by full of the output queue.
  
  MFC after:3 days
  Tested by:bsduser bsd at acd.homelinux.org

Modified:
  head/sys/dev/usb/wlan/if_rum.c

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Wed Oct 14 19:24:01 2009
(r198097)
+++ head/sys/dev/usb/wlan/if_rum.c  Wed Oct 14 20:09:09 2009
(r198098)
@@ -826,6 +826,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RUM_UNLOCK(sc);
+   rum_start(ifp);
+   RUM_LOCK(sc);
break;
 
default:/* Error */
@@ -930,8 +933,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RUM_UNLOCK(sc);
if (m) {
-   RUM_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -941,8 +944,11 @@ tr_setup:
} else
(void) ieee80211_input_all(ic, m, rssi,
RT2573_NOISE_FLOOR);
-   RUM_LOCK(sc);
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   rum_start(ifp);
+   RUM_LOCK(sc);
return;
 
default:/* Error */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198099 - head/sys/dev/usb/wlan

2009-10-14 Thread Weongyo Jeong
Author: weongyo
Date: Wed Oct 14 20:30:27 2009
New Revision: 198099
URL: http://svn.freebsd.org/changeset/base/198099

Log:
  fixes a TX hang that could be possible to happen when the trasfers are
  in the high speed that some drivers don't call if_start callback after
  marking ~IFF_DRV_OACTIVE.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_uath.c
==
--- head/sys/dev/usb/wlan/if_uath.c Wed Oct 14 20:09:09 2009
(r198098)
+++ head/sys/dev/usb/wlan/if_uath.c Wed Oct 14 20:30:27 2009
(r198099)
@@ -2762,6 +2762,9 @@ setup:
m = NULL;
desc = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   uath_start(ifp);
UATH_LOCK(sc);
break;
default:

Modified: head/sys/dev/usb/wlan/if_upgt.c
==
--- head/sys/dev/usb/wlan/if_upgt.c Wed Oct 14 20:09:09 2009
(r198098)
+++ head/sys/dev/usb/wlan/if_upgt.c Wed Oct 14 20:30:27 2009
(r198099)
@@ -2291,6 +2291,9 @@ setup:
(void) ieee80211_input_all(ic, m, rssi, nf);
m = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   upgt_start(ifp);
UPGT_LOCK(sc);
break;
default:

Modified: head/sys/dev/usb/wlan/if_ural.c
==
--- head/sys/dev/usb/wlan/if_ural.c Wed Oct 14 20:09:09 2009
(r198098)
+++ head/sys/dev/usb/wlan/if_ural.c Wed Oct 14 20:30:27 2009
(r198099)
@@ -837,6 +837,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RAL_UNLOCK(sc);
+   ural_start(ifp);
+   RAL_LOCK(sc);
break;
 
default:/* Error */
@@ -945,8 +948,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RAL_UNLOCK(sc);
if (m) {
-   RAL_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -954,8 +957,11 @@ tr_setup:
ieee80211_free_node(ni);
} else
(void) ieee80211_input_all(ic, m, rssi, nf);
-   RAL_LOCK(sc);
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   ural_start(ifp);
+   RAL_LOCK(sc);
return;
 
default:/* Error */

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Wed Oct 14 20:09:09 2009
(r198098)
+++ head/sys/dev/usb/wlan/if_urtw.c Wed Oct 14 20:30:27 2009
(r198099)
@@ -4072,6 +4072,9 @@ setup:
(void) ieee80211_input_all(ic, m, rssi, nf);
m = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   urtw_start(ifp);
URTW_LOCK(sc);
break;
default:

Modified: head/sys/dev/usb/wlan/if_zyd.c
==
--- head/sys/dev/usb/wlan/if_zyd.c  Wed Oct 14 20:09:09 2009
(r198098)
+++ head/sys/dev/usb/wlan/if_zyd.c  Wed Oct 14 20:30:27 2009
(r198099)
@@ -2322,6 +2322,9 @@ tr_setup:
} else
(void)ieee80211_input_all(ic, m, rssi, nf);
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   zyd_start(ifp);
ZYD_LOCK(sc);
break;
 
@@ -2431,6 +2434,9 @@ tr_setup:
usbd_xfer_set_priv(xfer, data);
usbd_transfer_submit(xfer);
}
+   ZYD_UNLOCK(sc);
+   zyd_start(ifp);
+   ZYD_LOCK(sc);
break;
 
default:/* Error */

svn commit: r197761 - in head/sys/dev/usb: . wlan

2009-10-04 Thread Weongyo Jeong
Author: weongyo
Date: Sun Oct  4 23:30:08 2009
New Revision: 197761
URL: http://svn.freebsd.org/changeset/base/197761

Log:
  updates device entries supported with the product name not magic numbers
  and sorts entries.  WUSB54GCV2 is added.
  
  Obtained from:OpenBSD

Modified:
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Oct  4 21:50:29 2009(r197760)
+++ head/sys/dev/usb/usbdevsSun Oct  4 23:30:08 2009(r197761)
@@ -908,6 +908,7 @@ product ASIX AX887720x7720  AX88772
 product ASUS WL167G0x1707  WL-167g Wireless Adapter
 product ASUS WL159G0x170c  WL-159g
 product ASUS A9T_WIFI  0x171b  A9T wireless
+product ASUS P5B_WIFI  0x171d  P5B wireless
 product ASUS RT2573_1  0x1723  RT2573
 product ASUS RT2573_2  0x1724  RT2573
 product ASUS LCM   0x1726  LCM display
@@ -975,6 +976,7 @@ product BELKIN F5D7051  0x7051  F5D7051 5
 product BELKIN F5D7050A0x705a  F5D7050A Wireless Adapter
 /* Also sold as 'Ativa 802.11g wireless card' */
 product BELKIN F5D7050_V4000   0x705c  F5D7050 v4000 Wireless Adapter
+product BELKIN F5D7050E0x705e  F5D7050E Wireless Adapter
 product BELKIN F5D9050V3   0x905b  F5D9050 ver 3 Wireless Adapter
 product BELKIN2 F5U002 0x0002  F5U002 Parallel printer
 
@@ -1656,6 +1658,7 @@ product LINKSYS2 WUSB11   0x2219  WUSB11 W
 product LINKSYS2 USB200M   0x2226  USB 2.0 10/100 Ethernet
 product LINKSYS3 WUSB11v28 0x2233  WUSB11 v2.8 Wireless Adapter
 product LINKSYS4 USB1000   0x0039  USB1000
+product LINKSYS4 WUSB54GCV20x0073  WUSB54GC v2
 
 /* Logitech products */
 product LOGITECH M2452 0x0203  M2452 keyboard
@@ -1876,6 +1879,7 @@ product NETGEAR EA101X0x1002  Ethernet
 product NETGEAR FA101  0x1020  Ethernet 10/100, USB1.1
 product NETGEAR FA120  0x1040  USB 2.0 Ethernet
 product NETGEAR WG111V2_2  0x4240  PrismGT USB 2.0 WLAN
+product NETGEAR WG111V30x4260  WG111v3
 product NETGEAR WG111U 0x4300  WG111U
 product NETGEAR WG111U_NF  0x4301  WG111U (no firmware)
 product NETGEAR WG111V20x6a00  WG111V2
@@ -2101,6 +2105,9 @@ product RALINK RT2573_2   0x9021  RT2501US
 /* Green House and CompUSA OEM this part */
 product REALTEK USBKR100   0x8150  USBKR100 USB Ethernet
 product REALTEK RTL81870x8187  RTL8187 Wireless Adapter
+product REALTEK RTL8187B_0 0x8189  RTL8187B Wireless Adapter
+product REALTEK RTL8187B_1 0x8197  RTL8187B Wireless Adapter
+product REALTEK RTL8187B_2 0x8198  RTL8187B Wireless Adapter
 
 /* Ricoh products */
 product RICOH VGPVCC2  0x1830  VGP-VCC2 Camera
@@ -2270,6 +2277,8 @@ product SITECOM SERIAL0x2068  USB to se
 product SITECOM2 WL022 0x182d  WL-022
 
 /* Sitecom Europe products */
+product SITECOMEU WL168V1  0x000d  WL-168 v1
+product SITECOMEU WL168V4  0x0028  WL-168 v4
 product SITECOMEU LN0280x061c  LN-028
 product SITECOMEU WL1130x9071  WL-113
 product SITECOMEU ZD1211B  0x9075  ZD1211B
@@ -2375,6 +2384,7 @@ product DIAMOND2 RIO600USB0x5001  Rio 60
 product DIAMOND2 RIO800USB 0x5002  Rio 800 USB
 
 /* Surecom Technology products */
+product SURECOM EP9001G2A  0x11f2  EP-9001-G rev 2A
 product SURECOM RT2570 0x11f3  RT2570
 product SURECOM RT2573 0x31f3  RT2573
 

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Sun Oct  4 21:50:29 2009
(r197760)
+++ head/sys/dev/usb/wlan/if_urtw.c Sun Oct  4 23:30:08 2009
(r197761)
@@ -102,23 +102,24 @@ TUNABLE_INT(hw.usb.urtw.preamble_mode,
 #defineURTW_REV_RTL8187B   0
 #defineURTW_REV_RTL8187L   1
 static const struct usb_device_id urtw_devs[] = {
-   { USB_VPI(USB_VENDOR_BELKIN, 0x705e, URTW_REV_RTL8187B) },
-   { USB_VPI(USB_VENDOR_REALTEK, 0x8189, URTW_REV_RTL8187B) },
-   { USB_VPI(USB_VENDOR_REALTEK, 0x8197, URTW_REV_RTL8187B) },
-   { USB_VPI(USB_VENDOR_REALTEK, 0x8198, URTW_REV_RTL8187B) },
-   { USB_VPI(USB_VENDOR_NETGEAR, 0x4260, URTW_REV_RTL8187B) },
+   URTW_DEV_B(NETGEAR, WG111V3),
+   URTW_DEV_B(REALTEK, RTL8187B_0),
+   URTW_DEV_B(REALTEK, RTL8187B_1),
+   URTW_DEV_B(REALTEK, RTL8187B_2),
+   URTW_DEV_B(SITECOMEU, WL168V4),
+   URTW_DEV_L(ASUS, P5B_WIFI),
+   URTW_DEV_L(BELKIN, F5D7050E),
+   URTW_DEV_L(LINKSYS4, WUSB54GCV2),
+   URTW_DEV_L(NETGEAR, WG111V2),
+   URTW_DEV_L(REALTEK, RTL8187),
+   URTW_DEV_L(SITECOMEU, WL168V1),
+   URTW_DEV_L(SURECOM, EP9001G2A),
{ USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) 

svn commit: r197724 - head/share/man/man4

2009-10-02 Thread Weongyo Jeong
Author: weongyo
Date: Sat Oct  3 02:28:28 2009
New Revision: 197724
URL: http://svn.freebsd.org/changeset/base/197724

Log:
  TRENDnet TEW-424UB has multiple revisions so clarify zyd(4) man page and
  adds a device to urtw(4).  The revision informations are as follows:
  
  rev A   ZD1211
  V2  SiS163U
  V2.1R   SiS163U
  V3.xR   RTL8187B
  
  and bump date.
  
  Obtained from:OpenBSD
  Reported by:  Albert Shih Albert.Shih at obspm.fr

Modified:
  head/share/man/man4/urtw.4
  head/share/man/man4/zyd.4

Modified: head/share/man/man4/urtw.4
==
--- head/share/man/man4/urtw.4  Fri Oct  2 23:48:42 2009(r197723)
+++ head/share/man/man4/urtw.4  Sat Oct  3 02:28:28 2009(r197724)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 25, 2009
+.Dd October 2, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
@@ -73,6 +73,7 @@ driver supports Realtek RTL8187B/L based
 .It Netgear WG111v2   RTL8225 USB
 .It Safehome WLG-1500SMA5 RTL8225 USB
 .It Shuttle XPC Accessory PN20RTL8225 USB
+.It TRENDnet TEW-424UB V3.xR  RTL8225 USB
 .El
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):

Modified: head/share/man/man4/zyd.4
==
--- head/share/man/man4/zyd.4   Fri Oct  2 23:48:42 2009(r197723)
+++ head/share/man/man4/zyd.4   Sat Oct  3 02:28:28 2009(r197724)
@@ -32,7 +32,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\ THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd November 1, 2008
+.Dd October 2, 2009
 .Dt ZYD 4
 .Os
 .Sh NAME
@@ -113,7 +113,7 @@ driver:
 .It Sweex wireless USB 54 Mbps
 .It Tekram/Siemens USB adapter
 .It Telegent TG54USB
-.It Trendnet TEW-424UB
+.It Trendnet TEW-424UB rev A
 .It Trendnet TEW-429UB
 .It TwinMOS G240
 .It Unicorn WL-54G
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196809 - head/sys/dev/usb/wlan

2009-09-03 Thread Weongyo Jeong
Author: weongyo
Date: Fri Sep  4 05:28:09 2009
New Revision: 196809
URL: http://svn.freebsd.org/changeset/base/196809

Log:
  fix a TX issue on big endian machines like powerpc or sparc64.  Now
  zyd(4) should work on all architectures.
  
  Obtained from:OpenBSD

Modified:
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_zyd.c
==
--- head/sys/dev/usb/wlan/if_zyd.c  Fri Sep  4 05:06:15 2009
(r196808)
+++ head/sys/dev/usb/wlan/if_zyd.c  Fri Sep  4 05:28:09 2009
(r196809)
@@ -2547,7 +2547,7 @@ zyd_tx_start(struct zyd_softc *sc, struc
 
bits = (rate == 11) ? (totlen * 16) + 10 :
((rate == 22) ? (totlen * 8) + 10 : (totlen * 8));
-   desc-plcp_length = bits / ratediv[phy];
+   desc-plcp_length = htole16(bits / ratediv[phy]);
desc-plcp_service = 0;
if (rate == 22  (bits % 11)  0  (bits % 11) = 3)
desc-plcp_service |= ZYD_PLCP_LENGEXT;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196003 - head/sys/conf

2009-07-31 Thread Weongyo Jeong
Author: weongyo
Date: Fri Jul 31 17:57:16 2009
New Revision: 196003
URL: http://svn.freebsd.org/changeset/base/196003

Log:
  add upgt
  
  Approved by:  re (kib)

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jul 31 16:00:41 2009(r196002)
+++ head/sys/conf/files Fri Jul 31 17:57:16 2009(r196003)
@@ -1627,6 +1627,7 @@ dev/usb/net/usb_ethernet.c \
 #
 dev/usb/wlan/if_rum.c  optional rum
 dev/usb/wlan/if_uath.c optional uath
+dev/usb/wlan/if_upgt.c optional upgt
 dev/usb/wlan/if_ural.c optional ural
 dev/usb/wlan/if_urtw.c optional urtw
 dev/usb/wlan/if_zyd.c  optional zyd
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r195978 - head/sys/dev/usb

2009-07-30 Thread Weongyo Jeong
Author: weongyo
Date: Thu Jul 30 18:53:06 2009
New Revision: 195978
URL: http://svn.freebsd.org/changeset/base/195978

Log:
  fixes a typo for DWA120 device ID.
  
  Reported by:  Alexander Kuznetsov skritku at gmail.com
  Approved by:  re (kib)

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Jul 30 18:28:00 2009(r195977)
+++ head/sys/dev/usb/usbdevsThu Jul 30 18:53:06 2009(r195978)
@@ -1177,12 +1177,12 @@ product DLINK DSB650TX_PNA  0x4003  1/10/1
 product DLINK DSB650TX30x400b  10/100 Ethernet
 product DLINK DSB650TX20x4102  10/100 Ethernet
 product DLINK DSB650   0xabc1  10/100 Ethernet
+product DLINK2 DWA120_NF   0x3a0d  DWA-120 (no firmware)
+product DLINK2 DWA120  0x3a0e  DWA-120
 product DLINK2 DWLG122C1   0x3c03  DWL-G122 c1
 product DLINK2 WUA1340 0x3c04  WUA-1340
 product DLINK2 DWA111  0x3c06  DWA-111
 product DLINK2 DWA110  0x3c07  DWA-110
-product DLINK2 DWA120_NF   0x3c0d  DWA-120 (no firmware)
-product DLINK2 DWA120  0x3c0e  DWA-120
 
 /* DMI products */
 product DMI CFSM_RW0xa109  CF/SM Reader/Writer
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r195915 - head/share/man/man4

2009-07-27 Thread Weongyo Jeong
Author: weongyo
Date: Mon Jul 27 18:07:44 2009
New Revision: 195915
URL: http://svn.freebsd.org/changeset/base/195915

Log:
  urtw(4) supports RTL8187B chipset now.
  
  Approved by:  re (kib)

Modified:
  head/share/man/man4/urtw.4

Modified: head/share/man/man4/urtw.4
==
--- head/share/man/man4/urtw.4  Mon Jul 27 17:08:06 2009(r195914)
+++ head/share/man/man4/urtw.4  Mon Jul 27 18:07:44 2009(r195915)
@@ -24,12 +24,12 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 15, 2008
+.Dd July 25, 2009
 .Dt URTW 4
 .Os
 .Sh NAME
 .Nm urtw
-.Nd Realtek RTL8187L USB IEEE 802.11b/g wireless network device
+.Nd Realtek RTL8187B/L USB IEEE 802.11b/g wireless network device
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following lines in your kernel configuration file:
@@ -52,7 +52,7 @@ if_urtw_load=YES
 The
 .Nm
 driver supports USB 802.11b/g wireless adapters based on the
-Realtek RTL8187L.
+Realtek RTL8187B/L.
 .Pp
 .Nm
 supports
@@ -66,7 +66,7 @@ For more information on configuring this
 .Sh HARDWARE
 The
 .Nm
-driver supports Realtek RTL8187L based wireless network devices, including:
+driver supports Realtek RTL8187B/L based wireless network devices, including:
 .Pp
 .Bl -column Shuttle XPC Accessory PN20 RTL8225 USB -compact -offset 6n
 .It Em Card   Radio   Bus
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


  1   2   >