svn commit: r238273 - in head: sbin/ifconfig sys/netinet6 usr.sbin/ndp

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 06:21:46 2012
New Revision: 238273
URL: http://svn.freebsd.org/changeset/base/238273

Log:
  Remove prefer_source address selection option.  FreeBSD has had an
  implementation of RFC 3484 for this purpose for a long time and 
prefer_source
  was never implemented actually.  ND6_IFF_PREFER_SOURCE macro is left intact.

Modified:
  head/sbin/ifconfig/af_inet6.c
  head/sbin/ifconfig/ifconfig.8
  head/sys/netinet6/nd6.h
  head/usr.sbin/ndp/ndp.8
  head/usr.sbin/ndp/ndp.c

Modified: head/sbin/ifconfig/af_inet6.c
==
--- head/sbin/ifconfig/af_inet6.c   Mon Jul  9 05:39:31 2012
(r238272)
+++ head/sbin/ifconfig/af_inet6.c   Mon Jul  9 06:21:46 2012
(r238273)
@@ -509,8 +509,6 @@ static struct cmd inet6_cmds[] = {
DEF_CMD(-ifdisabled,  -ND6_IFF_IFDISABLED,setnd6flags),
DEF_CMD(nud,  ND6_IFF_PERFORMNUD, setnd6flags),
DEF_CMD(-nud, -ND6_IFF_PERFORMNUD,setnd6flags),
-   DEF_CMD(prefer_source,ND6_IFF_PREFER_SOURCE,  setnd6flags),
-   DEF_CMD(-prefer_source,-ND6_IFF_PREFER_SOURCE,setnd6flags),
DEF_CMD(auto_linklocal,ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD(-auto_linklocal,-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD_ARG(pltime,   setip6pltime),

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Mon Jul  9 05:39:31 2012
(r238272)
+++ head/sbin/ifconfig/ifconfig.8   Mon Jul  9 06:21:46 2012
(r238273)
@@ -28,7 +28,7 @@
 .\ From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\ $FreeBSD$
 .\
-.Dd May 27, 2012
+.Dd July 9, 2012
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -716,12 +716,6 @@ Set a flag to enable Neighbor Unreachabi
 .It Cm -nud
 Clear a flag
 .Cm nud .
-.It Cm prefer_source
-Set a flag to prefer addresses on the interface as candidates of the
-source address for outgoing packets.
-.It Cm -prefer_source
-Clear a flag
-.Cm prefer_source .
 .El
 .Pp
 The following parameters are specific to cloning

Modified: head/sys/netinet6/nd6.h
==
--- head/sys/netinet6/nd6.h Mon Jul  9 05:39:31 2012(r238272)
+++ head/sys/netinet6/nd6.h Mon Jul  9 06:21:46 2012(r238273)
@@ -79,7 +79,7 @@ struct nd_ifinfo {
 
 #define ND6_IFF_PERFORMNUD 0x1
 #define ND6_IFF_ACCEPT_RTADV   0x2
-#define ND6_IFF_PREFER_SOURCE  0x4 /* XXX: not related to ND. */
+#define ND6_IFF_PREFER_SOURCE  0x4 /* Not used in FreeBSD. */
 #define ND6_IFF_IFDISABLED 0x8 /* IPv6 operation is disabled due to
 * DAD failure.  (XXX: not ND-specific)
 */

Modified: head/usr.sbin/ndp/ndp.8
==
--- head/usr.sbin/ndp/ndp.8 Mon Jul  9 05:39:31 2012(r238272)
+++ head/usr.sbin/ndp/ndp.8 Mon Jul  9 06:21:46 2012(r238273)
@@ -29,7 +29,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 2, 2009
+.Dd July 9, 2012
 .Dt NDP 8
 .Os
 .\
@@ -192,15 +192,6 @@ on
 This flag is set by
 .Va net.inet6.ip6.auto_linklocal
 sysctl variable.
-.It Ic prefer_source
-Prefer addresses on the
-.Ar interface
-as candidates of the source address for outgoing packets.
-The default value of this flag is off.
-For more details about the entire algorithm of source address
-selection, see the
-.Pa IMPLEMENTATION
-file supplied with the KAME kit.
 .It Ic disabled
 Disable IPv6 operation on the interface.
 When disabled, the interface discards any IPv6 packets

Modified: head/usr.sbin/ndp/ndp.c
==
--- head/usr.sbin/ndp/ndp.c Mon Jul  9 05:39:31 2012(r238272)
+++ head/usr.sbin/ndp/ndp.c Mon Jul  9 06:21:46 2012(r238273)
@@ -1008,9 +1008,6 @@ ifinfo(ifname, argc, argv)
 #ifdef ND6_IFF_AUTO_LINKLOCAL
SETFLAG(auto_linklocal, ND6_IFF_AUTO_LINKLOCAL);
 #endif
-#ifdef ND6_IFF_PREFER_SOURCE
-   SETFLAG(prefer_source, ND6_IFF_PREFER_SOURCE);
-#endif
SETVALUE(basereachable, ND.basereachable);
SETVALUE(retrans, ND.retrans);
SETVALUE(curhlim, ND.chlim);
@@ -1084,10 +1081,6 @@ ifinfo(ifname, argc, argv)
if ((ND.flags  ND6_IFF_AUTO_LINKLOCAL))
printf(auto_linklocal );
 #endif
-#ifdef ND6_IFF_PREFER_SOURCE
-   if ((ND.flags  ND6_IFF_PREFER_SOURCE))
-   printf(prefer_source );
-#endif
}
putc('\n', stdout);
 #undef ND
___
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: r238274 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 06:34:15 2012
New Revision: 238274
URL: http://svn.freebsd.org/changeset/base/238274

Log:
  - Add support of the following USB devices to run(4):
  
   * Logitec LAN-W150N/U2
   * Buffalo WLI-UC-GNM2
  
  - Add device id of Planex GW-USValue-EZ.

Modified:
  head/share/man/man4/run.4
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_run.c

Modified: head/share/man/man4/run.4
==
--- head/share/man/man4/run.4   Mon Jul  9 06:21:46 2012(r238273)
+++ head/share/man/man4/run.4   Mon Jul  9 06:34:15 2012(r238274)
@@ -16,7 +16,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 7, 2012
+.Dd July 9, 2012
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -122,6 +122,8 @@ driver supports the following wireless a
 .It Buffalo WLI-UC-G300N
 .It Buffalo WLI-UC-G301N
 .It Buffalo WLI-UC-GN
+.It Buffalo WLI-UC-GNM
+.It Buffalo WLI-UC-GNM2
 .It Corega CG-WLUSB2GNL
 .It Corega CG-WLUSB2GNR
 .It Corega CG-WLUSB300AGN
@@ -142,6 +144,7 @@ driver supports the following wireless a
 .It Hercules HWNU-300
 .It Linksys WUSB54GC v3
 .It Linksys WUSB600N
+.It Logitec LAN-W150N/U2
 .It Mvix Nubbin MS-811N
 .It Planex GW-USMicroN
 .It Planex GW-US300MiniS

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsMon Jul  9 06:21:46 2012(r238273)
+++ head/sys/dev/usb/usbdevsMon Jul  9 06:34:15 2012(r238274)
@@ -2140,6 +2140,7 @@ product LOGITEC RT2870_1  0x0162  RT2870
 product LOGITEC RT2870_2   0x0163  RT2870
 product LOGITEC RT2870_3   0x0164  RT2870
 product LOGITEC LANW300NU2 0x0166  LAN-W300N/U2
+product LOGITEC LANW150NU2 0x0168  LAN-W150N/U2
 
 /* Longcheer Holdings, Ltd. products */
 product LONGCHEER WM66 0x6061  Longcheer WM66 HSDPA
@@ -2204,7 +2205,8 @@ product MELCO RT2870_10x0148  RT2870
 product MELCO RT2870_2 0x0150  RT2870
 product MELCO WLIUCGN  0x015d  WLI-UC-GN
 product MELCO WLIUCG301N   0x016f  WLI-UC-G301N
-product MELCO WLIUCGNM 0x01a2  WLI-UC-GNM
+product MELCO WLIUCGNM 0x01a2  WLI-UC-GNM
+product MELCO WLIUCGNM20x01ee  WLI-UC-GNM2
 
 /* Merlin products */
 product MERLIN V620 0x1110  Merlin V620
@@ -2618,6 +2620,7 @@ product PLANEX2 GWUS54GD  0xed01  GW-US54G
 product PLANEX2 GWUSMM 0xed02  GW-USMM
 product PLANEX2 RT2870 0xed06  RT2870
 product PLANEX2 GWUSMICRON 0xed14  GW-USMicroN
+product PLANEX2 GWUSVALUEEZ0xed17  GW-USValue-EZ
 product PLANEX3 GWUS54GZ   0xab10  GW-US54GZ
 product PLANEX3 GU1000T0xab11  GU-1000T
 product PLANEX3 GWUS54MINI 0xab13  GW-US54Mini

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Mon Jul  9 06:21:46 2012
(r238273)
+++ head/sys/dev/usb/wlan/if_run.c  Mon Jul  9 06:34:15 2012
(r238274)
@@ -209,6 +209,7 @@ static const STRUCT_USB_HOST_ID run_devs
 RUN_DEV(LOGITEC,   RT2870_2),
 RUN_DEV(LOGITEC,   RT2870_3),
 RUN_DEV(LOGITEC,   LANW300NU2),
+RUN_DEV(LOGITEC,   LANW150NU2),
 RUN_DEV(MELCO, RT2870_1),
 RUN_DEV(MELCO, RT2870_2),
 RUN_DEV(MELCO, WLIUCAG300N),
@@ -216,6 +217,7 @@ static const STRUCT_USB_HOST_ID run_devs
 RUN_DEV(MELCO, WLIUCG301N),
 RUN_DEV(MELCO, WLIUCGN),
 RUN_DEV(MELCO, WLIUCGNM),
+RUN_DEV(MELCO, WLIUCGNM2),
 RUN_DEV(MOTOROLA4, RT2770),
 RUN_DEV(MOTOROLA4, RT3070),
 RUN_DEV(MSI,   RT3070_1),
___
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: r238275 - head/sys/dev/ath

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 06:39:46 2012
New Revision: 238275
URL: http://svn.freebsd.org/changeset/base/238275

Log:
  Extend the RX descriptor completion debugging to log the larger
  AR93xx receive descriptors.
  
  This isn't entirely complete - the AR93xx and later descriptors
  don't have a link/buffer pointer; the descriptor contents just
  start.

Modified:
  head/sys/dev/ath/if_ath_debug.c

Modified: head/sys/dev/ath/if_ath_debug.c
==
--- head/sys/dev/ath/if_ath_debug.c Mon Jul  9 06:34:15 2012
(r238274)
+++ head/sys/dev/ath/if_ath_debug.c Mon Jul  9 06:39:46 2012
(r238275)
@@ -118,6 +118,16 @@ ath_printrxbuf(struct ath_softc *sc, con
ds-ds_hw[2], ds-ds_hw[3], ds-ds_hw[4],
ds-ds_hw[5], ds-ds_hw[6], ds-ds_hw[7],
ds-ds_hw[8]);
+   } else if (ah-ah_magic == 0x19741014) {
+   printf(%08x %08x %08x %08x %08x %08x %08x\n,
+   ds-ds_hw[2], ds-ds_hw[3], ds-ds_hw[4],
+   ds-ds_hw[5], ds-ds_hw[6], ds-ds_hw[7],
+   ds-ds_hw[8]);
+
+   printf(%08x %08x %08x %08x %08x %08x %08x\n,
+   ds-ds_hw[9], ds-ds_hw[10], ds-ds_hw[11],
+   ds-ds_hw[12], ds-ds_hw[13], ds-ds_hw[14],
+   ds-ds_hw[15]);
}
}
 }
___
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: r238276 - head/sys/dev/ath/ath_hal

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 06:41:18 2012
New Revision: 238276
URL: http://svn.freebsd.org/changeset/base/238276

Log:
  Extend the debugging flags to include some AR9300 HAL related options.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ah_debug.h

Modified: head/sys/dev/ath/ath_hal/ah_debug.h
==
--- head/sys/dev/ath/ath_hal/ah_debug.h Mon Jul  9 06:39:46 2012
(r238275)
+++ head/sys/dev/ath/ath_hal/ah_debug.h Mon Jul  9 06:41:18 2012
(r238276)
@@ -47,6 +47,11 @@ enum {
HAL_DEBUG_DIVERSITY = 0x0010,   /* diversity debugging */
HAL_DEBUG_DFS   = 0x0020,   /* DFS debugging */
HAL_DEBUG_HANG  = 0x0040,   /* BB/MAC hang debugging */
+   HAL_DEBUG_CALIBRATE = 0x0080,   /* setup calibration */
+   HAL_DEBUG_POWER_MGMT= 0x0100,   /* power calibration */
+   HAL_DEBUG_CHANNEL   = 0x0200,
+   HAL_DEBUG_QUEUE = 0x0400,
+   HAL_DEBUG_PRINT_REG = 0x0800,
 
HAL_DEBUG_UNMASKABLE= 0x8000,   /* always printed */
HAL_DEBUG_ANY   = 0x
___
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: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 07:16:19 2012
New Revision: 238277
URL: http://svn.freebsd.org/changeset/base/238277

Log:
  Make ipfw0 logging pseudo-interface clonable.  It can be created automatically
  by $firewall_logif rc.conf(5) variable at boot time or manually by ifconfig(8)
  after a boot.
  
  Discussed on: freebsd-ipfw@

Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/ipfw
  head/sbin/ipfw/ipfw.8
  head/share/man/man5/rc.conf.5
  head/sys/netinet/ipfw/ip_fw_log.c

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Mon Jul  9 06:41:18 2012(r238276)
+++ head/etc/defaults/rc.conf   Mon Jul  9 07:16:19 2012(r238277)
@@ -123,6 +123,7 @@ firewall_script=/etc/rc.firewall # Whi
 firewall_type=UNKNOWN# Firewall type (see /etc/rc.firewall)
 firewall_quiet=NO# Set to YES to suppress rule display
 firewall_logging=NO  # Set to YES to enable events logging
+firewall_logif=NO# Set to YES to create logging-pseudo interface
 firewall_flags=  # Flags passed to ipfw when type is a file
 firewall_coscripts=  # List of executables/scripts to run after
# firewall starts/stops

Modified: head/etc/rc.d/ipfw
==
--- head/etc/rc.d/ipfw  Mon Jul  9 06:41:18 2012(r238276)
+++ head/etc/rc.d/ipfw  Mon Jul  9 07:16:19 2012(r238277)
@@ -57,6 +57,10 @@ ipfw_start()
echo 'Firewall logging enabled.'
sysctl net.inet.ip.fw.verbose=1 /dev/null
fi
+   if checkyesno firewall_logif; then
+   ifconfig ipfw0 create
+   echo 'Firewall logging pseudo-interface (ipfw0) created.'
+   fi
 }
 
 ipfw_poststart()

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Mon Jul  9 06:41:18 2012(r238276)
+++ head/sbin/ipfw/ipfw.8   Mon Jul  9 07:16:19 2012(r238277)
@@ -1,7 +1,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 3, 2012
+.Dd July 9, 2012
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -560,7 +560,22 @@ is set to 0 (default), one can use
 .Xr bpf 4
 attached to the
 .Li ipfw0
-pseudo interface. There is no overhead if no
+pseudo interface.
+This pseudo interface can be created after a boot
+manually by using the following command:
+.Bd -literal -offset indent
+# ifconfig ipfw0 create
+.Ed
+.Pp
+Or, automatically at boot time by adding the following
+line to the
+.Xr rc.conf 5
+file:
+.Bd -literal -offset indent
+firewall_logif=YES
+.Ed
+.Pp
+There is no overhead if no
 .Xr bpf 4
 is attached to the pseudo interface.
 .Pp

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Mon Jul  9 06:41:18 2012
(r238276)
+++ head/share/man/man5/rc.conf.5   Mon Jul  9 07:16:19 2012
(r238277)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 6, 2012
+.Dd July 9, 2012
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -501,6 +501,16 @@ to enable firewall event logging.
 This is equivalent to the
 .Dv IPFIREWALL_VERBOSE
 kernel option.
+.It Va firewall_logif
+.Pq Vt bool
+Set to
+.Dq Li YES
+to create pseudo interface
+.Li ipfw0
+for logging.
+For more details, see
+.Xr ipfw 8
+manual page.
 .It Va firewall_flags
 .Pq Vt str
 Flags passed to

Modified: head/sys/netinet/ipfw/ip_fw_log.c
==
--- head/sys/netinet/ipfw/ip_fw_log.c   Mon Jul  9 06:41:18 2012
(r238276)
+++ head/sys/netinet/ipfw/ip_fw_log.c   Mon Jul  9 07:16:19 2012
(r238277)
@@ -44,8 +44,11 @@ __FBSDID($FreeBSD$);
 #include sys/socket.h
 #include sys/sysctl.h
 #include sys/syslog.h
+#include sys/lock.h
+#include sys/rwlock.h
 #include net/ethernet.h /* for ETHERTYPE_IP */
 #include net/if.h
+#include net/if_clone.h
 #include net/vnet.h
 #include net/if_types.h  /* for IFT_ETHER */
 #include net/bpf.h   /* for BPF */
@@ -90,6 +93,15 @@ ipfw_log_bpf(int onoff)
 }
 #else /* !WITHOUT_BPF */
 static struct ifnet *log_if;   /* hook to attach to bpf */
+static struct rwlock log_if_lock;
+#defineLOGIF_LOCK_INIT(x)  rw_init(log_if_lock, ipfw log_if 
lock)
+#defineLOGIF_LOCK_DESTROY(x)   rw_destroy(log_if_lock)
+#defineLOGIF_RLOCK(x)  rw_rlock(log_if_lock)
+#defineLOGIF_RUNLOCK(x)rw_runlock(log_if_lock)
+#defineLOGIF_WLOCK(x)  rw_wlock(log_if_lock)
+#defineLOGIF_WUNLOCK(x)rw_wunlock(log_if_lock)
+
+#defineIPFWNAMEipfw
 
 /* we use this dummy function for all ifnet callbacks */
 static int
@@ -116,37 +128,105 @@ ipfw_log_start(struct ifnet* ifp)
 static const u_char ipfwbroadcastaddr[6] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 
+static int

svn commit: r238278 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 07:19:11 2012
New Revision: 238278
URL: http://svn.freebsd.org/changeset/base/238278

Log:
  Extend the RX HAL API to include the RX queue identifier.
  
  The AR93xx and later chips support two RX FIFO queues - a high and low
  priority queue.
  
  For legacy chips, just assume the queues are high priority.
  
  This is inspired by the reference driver but is a reimplementation of
  the API and code.

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211.h
  head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212.h
  head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Mon Jul  9 07:16:19 2012
(r238277)
+++ head/sys/dev/ath/ath_hal/ah.h   Mon Jul  9 07:19:11 2012
(r238278)
@@ -1078,8 +1078,8 @@ struct ath_hal {
const struct ath_desc *ds, int *rates, int 
*tries);
 
/* Receive Functions */
-   uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*);
-   void  __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp);
+   uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE);
+   void  __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp, 
HAL_RX_QUEUE);
void  __ahdecl(*ah_enableReceive)(struct ath_hal*);
HAL_BOOL  __ahdecl(*ah_stopDmaReceive)(struct ath_hal*);
void  __ahdecl(*ah_startPcuReceive)(struct ath_hal*);

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h
==
--- head/sys/dev/ath/ath_hal/ar5210/ar5210.hMon Jul  9 07:16:19 2012
(r238277)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210.hMon Jul  9 07:19:11 2012
(r238278)
@@ -180,8 +180,8 @@ extern  void ar5210IntrReqTxDesc(struct 
 extern HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah,
const struct ath_desc *, int *rates, int *tries);
 
-extern uint32_t ar5210GetRxDP(struct ath_hal *);
-extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp);
+extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE);
+extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE);
 extern void ar5210EnableReceive(struct ath_hal *);
 extern HAL_BOOL ar5210StopDmaReceive(struct ath_hal *);
 extern void ar5210StartPcuReceive(struct ath_hal *);

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
==
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c   Mon Jul  9 07:16:19 
2012(r238277)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c   Mon Jul  9 07:19:11 
2012(r238278)
@@ -30,8 +30,10 @@
  * Get the RXDP.
  */
 uint32_t
-ar5210GetRxDP(struct ath_hal *ah)
+ar5210GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype)
 {
+
+   HALASSERT(qtype == HAL_RX_QUEUE_HP);
return OS_REG_READ(ah, AR_RXDP);
 }
 
@@ -39,8 +41,10 @@ ar5210GetRxDP(struct ath_hal *ah)
  * Set the RxDP.
  */
 void
-ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp)
+ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype)
 {
+
+   HALASSERT(qtype == HAL_RX_QUEUE_HP);
OS_REG_WRITE(ah, AR_RXDP, rxdp);
 }
 

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h
==
--- head/sys/dev/ath/ath_hal/ar5211/ar5211.hMon Jul  9 07:16:19 2012
(r238277)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211.hMon Jul  9 07:19:11 2012
(r238278)
@@ -205,8 +205,8 @@ extern  void ar5211IntrReqTxDesc(struct 
 extern HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah,
const struct ath_desc *ds0, int *rates, int *tries);
 
-extern uint32_t ar5211GetRxDP(struct ath_hal *);
-extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp);
+extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX_QUEUE);
+extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE);
 extern void ar5211EnableReceive(struct ath_hal *);
 extern HAL_BOOL ar5211StopDmaReceive(struct ath_hal *);
 extern void ar5211StartPcuReceive(struct ath_hal *);

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
==
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c   Mon Jul  9 07:16:19 
2012(r238277)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c   Mon Jul  9 07:19:11 
2012(r238278)
@@ -30,8 +30,10 @@
  * Get the RXDP.
  */
 uint32_t
-ar5211GetRxDP(struct ath_hal *ah)
+ar5211GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype)
 {
+
+   HALASSERT(qtype == HAL_RX_QUEUE_HP);
return 

Re: svn commit: r238213 - head/sys/geom

2012-07-09 Thread Edward Tomasz Napierała
Wiadomość napisana przez Pawel Jakub Dawidek w dniu 8 lip 2012, o godz. 23:38:
 On Sun, Jul 08, 2012 at 12:53:37AM +0200, Edward Tomasz Napierała wrote:
 Wiadomość napisana przez Pawel Jakub Dawidek w dniu 7 lip 2012, o godz. 
 23:54:
 You will also notice that one of those fields were left for more
 universal method to handle various provider's property changes (ie.
 provider's name, apart from its mediasize). The initial patch was even
 published a year ago:
 
 http://people.freebsd.org/~pjd/patches/geom_property_change.patch
 
 Even if it was somehow totally not reusable it would at least give you a
 hint that mediasize is not the only thing that can change and if we are
 making that change it should be done right.
 
 I was not aware of that patch. [...]
 
 I'm afraid that's a lie. From IRC logs:
 
 pjd rwatson: 
 http://people.freebsd.org/~pjd/patches/geom_property_change.patch
 pjd rwatson: Not tested.
 trasz pjd: shouldn't there also be a flag for geom to veto resizing?
 trasz pjd: for classes that can't handle their consumers changing size?
 [the discussion was pretty long]

And when exactly was that?  A year ago?

 [...] What I've considered was to use attributes
 instead, but that would complicate notifying consumers about resizing
 and would require some special-casing in the attribute code.
 
 What attributes? The ones handled by BIO_GETATTR? They are about
 something totally different.

Yes, but they could be used to notify about mediasize change.

Now, I'm not sure if I like your approach.  You're trying to generalize
from a single case.  And even for that single case your approach would
require a special case to retaste the provider after updating mediasize,
and perhaps do the orphanisation stuff before.

Also, why would we want this generalisation?  Resize handling is completely
different from e.g. rename handling; why should we have a single method
to do both?  It's not that geom structures are like mbufs or vnodes, where
every byte counts.

 +  G_VALID_PROVIDER(pp);
 
 Is this your protection from a provider going away?
 
 Can you suggest a way to do it in a safe way that doesn't involve
 rewriting most of GEOM?
 
 I can only suggest not to rewrite GEOM because you didn't take the time
 to understand it.

Let me quote a comment from the top of geom_event.c:

/*
 * XXX: How do we in general know that objects referenced in events
 * have not been destroyed before we get around to handle the event ?
 */

So, can you suggest a way to do it in a safe way that doesn't involve
rewriting most of GEOM?

 Why is this safe to call the orphan method directly and not use
 g_orphan_provider()? I don't know if using g_orphan_provider() is safe
 to use here either, but I'm under impression that you assume no orphan
 method will ever drop the topology lock? We have tools to assert that,
 no need to introduce such weak assumptions.
 
 It's not that using g_orphan_provider() would be safer here - it simply
 wouldn't work.  The way it works is by adding providers to a queue
 (g_doorstep).  _Providers_, and we need to orphan individual consumers.
 So, this would involve rewriting the orphanisation mechanism.  Also,
 most of the classes were fixed by mav@ to handle this correctly, IIRC.
 
 By introducing such hacks you make the code unpredictable. The way
 g_orphan_provider() works is more than just calling geom's orphan
 method. Also, until now, when orphan method was called it meant that
 provider is going away, which is not true anymore. I'd like to believe
 that you carefully analysed what you changed here is safe, but based on
 your understanding of GEOM, I doubt that.

Look, I really appreciate you're looking at this just six months after
explicitly refusing to talk to me about the design, but it would be great
if it was a _technical_ discussion.

Now, the only reason for the orphaning during resizing is backward
compatibility with classes that don't know anything about the resize()
method, to make sure the provider doesn't get shrunk without them knowing. 
Your patch didn't do that, and perhaps we could just get rid of it.
I think the current approach is safer, though.

-- 
If you cut off my head, what would I say?  Me and my head, or me and my body?

___
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: r238279 - in head: sys/dev/usb usr.sbin/usbdump

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 07:25:09 2012
New Revision: 238279
URL: http://svn.freebsd.org/changeset/base/238279

Log:
  Make usbusN logging pseudo-interface used by usbdump(8) clonable.  One is
  now created/destroyed automatically by usbdump(8).
  
  Note that hw.usb.no_pf loader tunable is now obsolete.
  
  Reviewed by:  hselasky

Modified:
  head/sys/dev/usb/usb_pf.c
  head/usr.sbin/usbdump/usbdump.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Mon Jul  9 07:19:11 2012(r238278)
+++ head/sys/dev/usb/usb_pf.c   Mon Jul  9 07:25:09 2012(r238279)
@@ -44,8 +44,10 @@ __FBSDID($FreeBSD$);
 #include sys/sockio.h
 #include net/if.h
 #include net/if_types.h
+#include net/if_clone.h
 #include net/bpf.h
 #include sys/sysctl.h
+#include net/route.h
 
 #include dev/usb/usb.h
 #include dev/usb/usbdi.h
@@ -58,35 +60,144 @@ __FBSDID($FreeBSD$);
 #include dev/usb/usb_pf.h
 #include dev/usb/usb_transfer.h
 
-static int usb_no_pf;
+#defineUSBUSNAME   usbus
 
-SYSCTL_INT(_hw_usb, OID_AUTO, no_pf, CTLFLAG_RW,
-usb_no_pf, 0, Set to disable USB packet filtering);
+static void usbpf_init(void);
+static void usbpf_uninit(void);
+static int usbpf_ioctl(struct ifnet *, u_long, caddr_t);
+static int usbpf_clone_match(struct if_clone *, const char *);
+static int usbpf_clone_create(struct if_clone *, char *, size_t, caddr_t);
+static int usbpf_clone_destroy(struct if_clone *, struct ifnet *);
+static struct usb_bus *usbpf_ifname2ubus(const char *);
+static uint32_t usbpf_aggregate_xferflags(struct usb_xfer_flags *);
+static uint32_t usbpf_aggregate_status(struct usb_xfer_flags_int *);
+static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t);
+static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int);
+
+static struct if_clone usbpf_cloner = IFC_CLONE_INITIALIZER(
+USBUSNAME, NULL, IF_MAXUNIT,
+NULL, usbpf_clone_match, usbpf_clone_create, usbpf_clone_destroy);
 
-TUNABLE_INT(hw.usb.no_pf, usb_no_pf);
+SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL);
+SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL);
 
-void
-usbpf_attach(struct usb_bus *ubus)
+static void
+usbpf_init(void)
 {
-   struct ifnet *ifp;
 
-   if (usb_no_pf != 0) {
-   ubus-ifp = NULL;
+   if_clone_attach(usbpf_cloner);
+}
+
+static void
+usbpf_uninit(void)
+{
+   int devlcnt;
+   device_t *devlp;
+   devclass_t dc;
+   struct usb_bus *ubus;
+   int error;
+   int i;
+   
+   if_clone_detach(usbpf_cloner);
+
+   dc = devclass_find(USBUSNAME);
+   if (dc == NULL)
return;
+   error = devclass_get_devices(dc, devlp, devlcnt);
+   if (error)
+   return;
+   for (i = 0; i  devlcnt; i++) {
+   ubus = device_get_softc(devlp[i]);
+   if (ubus != NULL  ubus-ifp != NULL)
+   usbpf_clone_destroy(usbpf_cloner, ubus-ifp);
}
+}
+
+static int
+usbpf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
+{
+   
+   /* No configuration allowed. */
+   return (EINVAL);
+}
+
+static struct usb_bus *
+usbpf_ifname2ubus(const char *ifname)
+{
+   device_t dev;
+   devclass_t dc;
+   int unit;
+   int error;
+
+   if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME)) = 0)
+   return (NULL);
+   error = ifc_name2unit(ifname, unit);
+   if (error || unit  0)
+   return (NULL);
+   dc = devclass_find(USBUSNAME);
+   if (dc == NULL)
+   return (NULL);
+   dev = devclass_get_device(dc, unit);
+   if (dev == NULL)
+   return (NULL);
+
+   return (device_get_softc(dev));
+}
+
+static int
+usbpf_clone_match(struct if_clone *ifc, const char *name)
+{
+   struct usb_bus *ubus;
+
+   ubus = usbpf_ifname2ubus(name);
+   if (ubus == NULL)
+   return (0);
+   if (ubus-ifp != NULL)
+   return (0);
+
+   return (1);
+}
+
+static int
+usbpf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t 
params)
+{
+   int error;
+   int unit;
+   struct ifnet *ifp;
+   struct usb_bus *ubus;
 
+   error = ifc_name2unit(name, unit);
+   if (error || unit  0)
+   return (error);
+
+   ubus = usbpf_ifname2ubus(name);
+   if (ubus == NULL)
+   return (1);
+   if (ubus-ifp != NULL)
+   return (1);
+
+   error = ifc_alloc_unit(ifc, unit);
+   if (error) {
+   ifc_free_unit(ifc, unit);
+   device_printf(ubus-parent, usbpf: Could not allocate 
+   instance\n);
+   return (error);
+   }
ifp = ubus-ifp = if_alloc(IFT_USB);
if (ifp == NULL) {
+   ifc_free_unit(ifc, unit);
device_printf(ubus-parent, usbpf: Could not allocate 
 

svn commit: r238280 - in head/sys/dev/ath: . ath_hal

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 07:31:26 2012
New Revision: 238280
URL: http://svn.freebsd.org/changeset/base/238280

Log:
  Introduce the EDMA related HAL capabilities.
  
  Whilst here, fix a typo in a previous commit.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah.c
==
--- head/sys/dev/ath/ath_hal/ah.c   Mon Jul  9 07:25:09 2012
(r238279)
+++ head/sys/dev/ath/ath_hal/ah.c   Mon Jul  9 07:31:26 2012
(r238280)
@@ -619,6 +619,33 @@ ath_hal_getcapability(struct ath_hal *ah
return pCap-hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_EXT_CHAN_DFS:
return pCap-halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_NUM_TXMAPS:
+   *result = pCap-halNumTxMaps;
+   return HAL_OK;
+   case HAL_CAP_TXDESCLEN:
+   *result = pCap-halTxDescLen;
+   return HAL_OK;
+   case HAL_CAP_TXSTATUSLEN:
+   *result = pCap-halTxStatusLen;
+   return HAL_OK;
+   case HAL_CAP_RXSTATUSLEN:
+   *result = pCap-halRxStatusLen;
+   return HAL_OK;
+   case HAL_CAP_RXFIFODEPTH:
+   switch (capability) {
+   case HAL_RX_QUEUE_HP:
+   *result = pCap-halRxHpFifoDepth;
+   return HAL_OK;
+   case HAL_RX_QUEUE_LP:
+   *result = pCap-halRxLpFifoDepth;
+   return HAL_OK;
+   default:
+   return HAL_ENOTSUPP;
+   }
+   case HAL_CAP_RXBUFSIZE:
+   case HAL_CAP_NUM_MR_RETRIES:
+   return HAL_EINVAL;  /* XXX not yet */
+
case HAL_CAP_COMBINED_RADAR_RSSI:
return pCap-halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_AUTO_SLEEP:
@@ -667,6 +694,8 @@ ath_hal_getcapability(struct ath_hal *ah
return pCap-halHasBBReadWar? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */
return pCap-halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_ENHANCED_DMA_SUPPORT:
+   return pCap-halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP;
default:
return HAL_EINVAL;
}

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Mon Jul  9 07:25:09 2012
(r238279)
+++ head/sys/dev/ath/ath_hal/ah.h   Mon Jul  9 07:31:26 2012
(r238280)
@@ -149,9 +149,14 @@ typedef enum {
HAL_CAP_TS  = 72,   /* 3 stream */
 
HAL_CAP_ENHANCED_DMA_SUPPORT= 75,   /* DMA FIFO support */
+   HAL_CAP_NUM_TXMAPS  = 76,   /* Number of buffers in a transmit 
descriptor */
+   HAL_CAP_TXDESCLEN   = 77,   /* Length of transmit descriptor */
+   HAL_CAP_TXSTATUSLEN = 78,   /* Length of transmit status descriptor 
*/
+   HAL_CAP_RXSTATUSLEN = 79,   /* Length of transmit status descriptor 
*/
+   HAL_CAP_RXFIFODEPTH = 80,   /* Receive hardware FIFO depth */
+   HAL_CAP_RXBUFSIZE   = 81,   /* Receive Buffer Length */
+   HAL_CAP_NUM_MR_RETRIES  = 82,   /* limit on multirate retries */
 
-   HAL_CAP_RXBUFSIZE   = 81,
-   HAL_CAP_NUM_MR_RETRIES  = 82,
HAL_CAP_OL_PWRCTRL  = 84,   /* Open loop TX power control */
 
HAL_CAP_BB_PANIC_WATCHDOG   = 92,
@@ -210,7 +215,7 @@ typedef enum {
 
 typedef enum {
HAL_RX_QUEUE_HP = 0,/* high priority recv queue */
-   HAL_RX_QUEUE_LP = 0,/* low priority recv queue */
+   HAL_RX_QUEUE_LP = 1,/* low priority recv queue */
 } HAL_RX_QUEUE;
 
 #defineHAL_NUM_RX_QUEUES   2   /* max possible # of 
queues */

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hMon Jul  9 07:25:09 2012
(r238279)
+++ head/sys/dev/ath/if_athvar.hMon Jul  9 07:31:26 2012
(r238280)
@@ -953,11 +953,34 @@ void  ath_intr(void *);
 #defineath_hal_setintmit(_ah, _v) \
ath_hal_setcapability(_ah, HAL_CAP_INTMIT, \
HAL_CAP_INTMIT_ENABLE, _v, NULL)
+
+/* EDMA definitions */
 #defineath_hal_hasedma(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_ENHANCED_DMA_SUPPORT,   \
0, NULL) == HAL_OK)
+#defineath_hal_getrxfifodepth(_ah, _qtype, _req) \
+   (ath_hal_getcapability(_ah, HAL_CAP_RXFIFODEPTH, _qtype, _req)  \
+   == HAL_OK)
+#defineath_hal_getntxmaps(_ah, _req) \
+   (ath_hal_getcapability(_ah, HAL_CAP_NUM_TXMAPS, 0, 

Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw

2012-07-09 Thread Alexander V. Chernikov

On 09.07.2012 11:16, Hiroki Sato wrote:

Author: hrs
Date: Mon Jul  9 07:16:19 2012
New Revision: 238277
URL: http://svn.freebsd.org/changeset/base/238277

Log:
   Make ipfw0 logging pseudo-interface clonable.  It can be created 
automatically
   by $firewall_logif rc.conf(5) variable at boot time or manually by 
ifconfig(8)
   after a boot.

   Discussed on:freebsd-ipfw@

Em, well, I thought discussed means some kind of consensus?
There was an alternative implementation proposed in -ipfw with no 
comments from you side. Additionally, there can be other (still not 
discussed) solutions like making this interface as loadable module (like 
pf do).





___
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: r238281 - head/usr.sbin/newsyslog

2012-07-09 Thread Andrey V. Elsukov
Author: ae
Date: Mon Jul  9 07:37:10 2012
New Revision: 238281
URL: http://svn.freebsd.org/changeset/base/238281

Log:
  We don't need to check the result of sending signal when -R option is
  specified.
  
  Submitted by: Ilya A. Arkhipov
  MFC after:1 week

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

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Mon Jul  9 07:31:26 2012
(r238280)
+++ head/usr.sbin/newsyslog/newsyslog.c Mon Jul  9 07:37:10 2012
(r238281)
@@ -1972,7 +1972,8 @@ do_zipwork(struct zipwork_entry *zwork)
else
pgm_name++;
 
-   if (zwork-zw_swork != NULL  zwork-zw_swork-sw_pidok = 0) {
+   if (zwork-zw_swork != NULL  zwork-zw_swork-run_cmd == 0 
+   zwork-zw_swork-sw_pidok = 0) {
warnx(
log %s not compressed because daemon(s) not notified,
zwork-zw_fname);
___
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: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw

2012-07-09 Thread Hiroki Sato
Alexander V. Chernikov melif...@freebsd.org wrote
  in 4ffa894d.9050...@freebsd.org:

me On 09.07.2012 11:16, Hiroki Sato wrote:
me  Author: hrs
me  Date: Mon Jul  9 07:16:19 2012
me  New Revision: 238277
me  URL: http://svn.freebsd.org/changeset/base/238277
me 
me  Log:
me Make ipfw0 logging pseudo-interface clonable.  It can be created
me automatically
me by $firewall_logif rc.conf(5) variable at boot time or manually by
me ifconfig(8)
me after a boot.
me 
me Discussed on:  freebsd-ipfw@
me Em, well, I thought discussed means some kind of consensus?
me There was an alternative implementation proposed in -ipfw with no
me comments from you side. Additionally, there can be other (still not
me discussed) solutions like making this interface as loadable module
me (like pf do).

 I meant there was no strong objection.  I am sorry for not commenting
 your implementation, but at least for ipfw0 it is difficult to
 decouple ifnet and bpf because the primary consumer is tcpdump(8),
 which depends on NET_RT_IFLIST to find the target.  Probably your
 solution can be used for usbdump(8).  The reason why I committed the
 patch now is there are reports that these pseudo interfaces made some
 applications confused and/or caused some performance degradation on
 9.0R, and wanted to fix it in some way.

 I am still open for more sophisticated implementation and have no
 objection to replace mine with it.  Do you have an idea about
 converting it with a loadable module?

-- Hiroki


pgpRpchTh0luF.pgp
Description: PGP signature


svn commit: r238282 - in head: etc/rc.d usr.sbin/rarpd

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 08:11:16 2012
New Revision: 238282
URL: http://svn.freebsd.org/changeset/base/238282

Log:
  - Add IFT_L2VLAN (vlan(4)) support.
  - Add -P option to support PID file.  When -a is specified /var/run/rarpd.pid
is used, and when an interface is specified /var/run/rarpd.ifname.pid is
used by default.

Modified:
  head/etc/rc.d/rarpd
  head/usr.sbin/rarpd/Makefile
  head/usr.sbin/rarpd/rarpd.8
  head/usr.sbin/rarpd/rarpd.c

Modified: head/etc/rc.d/rarpd
==
--- head/etc/rc.d/rarpd Mon Jul  9 07:37:10 2012(r238281)
+++ head/etc/rc.d/rarpd Mon Jul  9 08:11:16 2012(r238282)
@@ -13,8 +13,9 @@
 name=rarpd
 rcvar=rarpd_enable
 command=/usr/sbin/${name}
-pidfile=/var/run/${name}.pid
 required_files=/etc/ethers
 
 load_rc_config $name
+pidfile=${rarpd_pidfile:-/var/run/${name}.pid}
+
 run_rc_command $1

Modified: head/usr.sbin/rarpd/Makefile
==
--- head/usr.sbin/rarpd/MakefileMon Jul  9 07:37:10 2012
(r238281)
+++ head/usr.sbin/rarpd/MakefileMon Jul  9 08:11:16 2012
(r238282)
@@ -4,6 +4,9 @@
 PROG=  rarpd
 MAN=   rarpd.8
 
+DPADD= ${LIBUTIL}
+LDADD= -lutil
+
 WARNS?=3
 # This breaks with format strings returned by expand_syslog_m().. argh!
 #FORMAT_AUDIT?=1

Modified: head/usr.sbin/rarpd/rarpd.8
==
--- head/usr.sbin/rarpd/rarpd.8 Mon Jul  9 07:37:10 2012(r238281)
+++ head/usr.sbin/rarpd/rarpd.8 Mon Jul  9 08:11:16 2012(r238282)
@@ -16,7 +16,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 16, 2001
+.Dd July 9, 2012
 .Dt RARPD 8
 .Os
 .Sh NAME
@@ -27,9 +27,11 @@
 .Fl a
 .Op Fl dfsv
 .Op Fl t Ar directory
+.Op Fl P Ar pidfile
 .Nm
 .Op Fl dfsv
 .Op Fl t Ar directory
+.Op Fl P Ar pidfile
 .Ar interface
 .Sh DESCRIPTION
 The
@@ -92,6 +94,15 @@ instead of via
 .Xr syslog 3 .
 .It Fl f
 Run in the foreground.
+.It Fl P
+Specify the pathname of the PID file.
+If not specified, 
+.Pa /var/run/rarpd.pid
+or
+.Pa /var/run/rarpd.ifname.pid
+will be used depending on the
+.Fl a
+flag or the specified interface name.
 .It Fl s
 Supply a response to any RARP request for which an ethernet to IP address
 mapping exists; do not depend on the existence of
@@ -115,6 +126,7 @@ Enable verbose syslogging.
 .It Pa /etc/ethers
 .It Pa /etc/hosts
 .It Pa /tftpboot
+.It Pa /var/run/rarpd.pid
 .El
 .Sh SEE ALSO
 .Xr bpf 4

Modified: head/usr.sbin/rarpd/rarpd.c
==
--- head/usr.sbin/rarpd/rarpd.c Mon Jul  9 07:37:10 2012(r238281)
+++ head/usr.sbin/rarpd/rarpd.c Mon Jul  9 08:11:16 2012(r238282)
@@ -27,8 +27,8 @@ __FBSDID($FreeBSD$);
 /*
  * rarpd - Reverse ARP Daemon
  *
- * Usage:  rarpd -a [-dfsv] [-t directory] [hostname]
- * rarpd [-dfsv] [-t directory] interface [hostname]
+ * Usage:  rarpd -a [-dfsv] [-t directory] [-P pidfile] [hostname]
+ * rarpd [-dfsv] [-t directory] [-P pidfile] interface [hostname]
  *
  * 'hostname' is optional solely for backwards compatibility with Sun's rarpd.
  * Currently, the argument is ignored.
@@ -61,6 +61,7 @@ __FBSDID($FreeBSD$);
 #include syslog.h
 #include stdlib.h
 #include unistd.h
+#include libutil.h
 
 /* Cast a struct sockaddr to a struct sockaddr_in */
 #define SATOSIN(sa) ((struct sockaddr_in *)(sa))
@@ -99,6 +100,11 @@ int sflag;  /* ignore /tftpboot */
 
 static u_char zero[6];
 
+static char pidfile_buf[PATH_MAX];
+static char *pidfile;
+#defineRARPD_PIDFILE   /var/run/rarpd.%s.pid
+static struct pidfh *pidfile_fh;
+
 static int bpf_open(void);
 static in_addr_t   choose_ipaddr(in_addr_t **, in_addr_t, in_addr_t);
 static char*eatoa(u_char *);
@@ -140,7 +146,7 @@ main(int argc, char *argv[])
openlog(name, LOG_PID | LOG_CONS, LOG_DAEMON);
 
opterr = 0;
-   while ((op = getopt(argc, argv, adfst:v)) != -1)
+   while ((op = getopt(argc, argv, adfsP:t:v)) != -1)
switch (op) {
case 'a':
++aflag;
@@ -158,6 +164,12 @@ main(int argc, char *argv[])
++sflag;
break;
 
+   case 'P':
+   strncpy(pidfile_buf, optarg, sizeof(pidfile_buf) - 1);
+   pidfile_buf[sizeof(pidfile_buf) - 1] = '\0';
+   pidfile = pidfile_buf;
+   break;
+
case 't':
tftp_dir = optarg;
break;
@@ -181,10 +193,23 @@ main(int argc, char *argv[])
init(ifname);
 
if (!fflag) {
+   if (pidfile == NULL  ifname != NULL  aflag == 0) {
+   snprintf(pidfile_buf, sizeof(pidfile_buf) - 1,
+   RARPD_PIDFILE, 

svn commit: r238283 - stable/9/gnu/usr.bin/gdb/kgdb

2012-07-09 Thread Robert Watson
Author: rwatson
Date: Mon Jul  9 08:27:04 2012
New Revision: 238283
URL: http://svn.freebsd.org/changeset/base/238283

Log:
  Merge r229521 from head to stable/9:
  
Add missing -w to kgdb(1)'s usage().
  
Sponsored by:   Adara Networks, Inc.
  
  Approved by:  re (kib)

Modified:
  stable/9/gnu/usr.bin/gdb/kgdb/main.c
Directory Properties:
  stable/9/gnu/usr.bin/gdb/kgdb/   (props changed)

Modified: stable/9/gnu/usr.bin/gdb/kgdb/main.c
==
--- stable/9/gnu/usr.bin/gdb/kgdb/main.cMon Jul  9 08:11:16 2012
(r238282)
+++ stable/9/gnu/usr.bin/gdb/kgdb/main.cMon Jul  9 08:27:04 2012
(r238283)
@@ -83,7 +83,7 @@ usage(void)
 {
 
fprintf(stderr,
-   usage: %s [-afqv] [-d crashdir] [-c core | -n dumpnr | -r 
device]\n
+   usage: %s [-afqvw] [-d crashdir] [-c core | -n dumpnr | -r 
device]\n
\t[kernel [core]]\n, getprogname());
exit(1);
 }
___
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: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw

2012-07-09 Thread Alexander V. Chernikov

On 09.07.2012 12:08, Hiroki Sato wrote:

Alexander V. Chernikovmelif...@freebsd.org  wrote
   in4ffa894d.9050...@freebsd.org:

  I meant there was no strong objection.  I am sorry for not commenting
  your implementation, but at least for ipfw0 it is difficult to
  decouple ifnet and bpf because the primary consumer is tcpdump(8),
  which depends on NET_RT_IFLIST to find the target.  Probably your

tcpdump -i still works with interface name supplied.

  solution can be used for usbdump(8).  The reason why I committed the
  patch now is there are reports that these pseudo interfaces made some
  applications confused and/or caused some performance degradation on
  9.0R, and wanted to fix it in some way.

Do you plan to take this to 9.1 ?


  I am still open for more sophisticated implementation and have no
  objection to replace mine with it.  Do you have an idea about
  converting it with a loadable module?
Personally I think that the right way is to add userkernel interface 
for requesting interface list since this is the most major stopper for 
doing BPF-only providers. However this should be discussed with rpaulo@ 
and delphij@ (so most probably this skips 9.1).


And, as fallback solution we can probably add separate ipfwlog module 
which is quite easy but much less clean.




-- Hiroki


___
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: r238284 - head/sys/dev/ath

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 08:37:59 2012
New Revision: 238284
URL: http://svn.freebsd.org/changeset/base/238284

Log:
  Further preparations for the RX EDMA support.
  
  Break out the DMA descriptor setup/teardown code into a method.
  The EDMA RX code doesn't allocate descriptors, just ath_buf entries.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_rx.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Jul  9 08:27:04 2012(r238283)
+++ head/sys/dev/ath/if_ath.c   Mon Jul  9 08:37:59 2012(r238284)
@@ -157,8 +157,6 @@ static void ath_update_promisc(struct if
 static voidath_updateslot(struct ifnet *);
 static voidath_bstuck_proc(void *, int);
 static voidath_reset_proc(void *, int);
-static voidath_descdma_cleanup(struct ath_softc *sc,
-   struct ath_descdma *, ath_bufhead *);
 static int ath_desc_alloc(struct ath_softc *);
 static voidath_desc_free(struct ath_softc *);
 static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *,
@@ -239,15 +237,15 @@ staticint ath_anicalinterval = 100;   /*
 SYSCTL_INT(_hw_ath, OID_AUTO, anical, CTLFLAG_RW, ath_anicalinterval,
0, ANI calibration (msecs));
 
-static int ath_rxbuf = ATH_RXBUF;  /* # rx buffers to allocate */
+int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */
 SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, ath_rxbuf,
0, rx buffers allocated);
 TUNABLE_INT(hw.ath.rxbuf, ath_rxbuf);
-static int ath_txbuf = ATH_TXBUF;  /* # tx buffers to allocate */
+int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */
 SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RW, ath_txbuf,
0, tx buffers allocated);
 TUNABLE_INT(hw.ath.txbuf, ath_txbuf);
-static int ath_txbuf_mgmt = ATH_MGMT_TXBUF;/* # mgmt tx buffers to 
allocate */
+int ath_txbuf_mgmt = ATH_MGMT_TXBUF;   /* # mgmt tx buffers to allocate */
 SYSCTL_INT(_hw_ath, OID_AUTO, txbuf_mgmt, CTLFLAG_RW, ath_txbuf_mgmt,
0, tx (mgmt) buffers allocated);
 TUNABLE_INT(hw.ath.txbuf_mgmt, ath_txbuf_mgmt);
@@ -308,9 +306,10 @@ ath_attach(u_int16_t devid, struct ath_s
 *
 * This is required before the descriptors are allocated.
 */
-   if (ath_hal_hasedma(sc-sc_ah))
+   if (ath_hal_hasedma(sc-sc_ah)) {
+   sc-sc_isedma = 1;
ath_recv_setup_edma(sc);
-   else
+   } else
ath_recv_setup_legacy(sc);
 
/*
@@ -378,6 +377,14 @@ ath_attach(u_int16_t devid, struct ath_s
if_printf(ifp, failed to allocate descriptors: %d\n, error);
goto bad;
}
+
+   error = ath_rxdma_setup(sc);
+   if (error != 0) {
+   if_printf(ifp, failed to allocate RX descriptors: %d\n,
+   error);
+   goto bad;
+   }
+
callout_init_mtx(sc-sc_cal_ch, sc-sc_mtx, 0);
callout_init_mtx(sc-sc_wd_ch, sc-sc_mtx, 0);
 
@@ -854,6 +861,7 @@ ath_attach(u_int16_t devid, struct ath_s
 bad2:
ath_tx_cleanup(sc);
ath_desc_free(sc);
+   ath_rxdma_teardown(sc);
 bad:
if (ah)
ath_hal_detach(ah);
@@ -896,6 +904,7 @@ ath_detach(struct ath_softc *sc)
 
ath_dfs_detach(sc);
ath_desc_free(sc);
+   ath_rxdma_teardown(sc);
ath_tx_cleanup(sc);
ath_hal_detach(sc-sc_ah);  /* NB: sets chip in full sleep */
if_free(ifp);
@@ -2594,6 +2603,13 @@ ath_mode_init(struct ath_softc *sc)
/* configure operational mode */
ath_hal_setopmode(ah);
 
+   DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_MODE,
+   %s: ah=%p, ifp=%p, if_addr=%p\n,
+   __func__,
+   ah,
+   ifp,
+   (ifp == NULL) ? NULL : ifp-if_addr);
+
/* handle any link-level address change */
ath_hal_setmac(ah, IF_LLADDR(ifp));
 
@@ -2724,7 +2740,7 @@ ath_load_cb(void *arg, bus_dma_segment_t
*paddr = segs-ds_addr;
 }
 
-static int
+int
 ath_descdma_setup(struct ath_softc *sc,
struct ath_descdma *dd, ath_bufhead *head,
const char *name, int nbuf, int ndesc)
@@ -2863,7 +2879,7 @@ fail0:
 #undef ATH_DESC_4KB_BOUND_CHECK
 }
 
-static void
+void
 ath_descdma_cleanup(struct ath_softc *sc,
struct ath_descdma *dd, ath_bufhead *head)
 {
@@ -2904,15 +2920,9 @@ ath_desc_alloc(struct ath_softc *sc)
 {
int error;
 
-   error = ath_descdma_setup(sc, sc-sc_rxdma, sc-sc_rxbuf,
-   rx, ath_rxbuf, 1);
-   if (error != 0)
-   return error;
-
error = ath_descdma_setup(sc, sc-sc_txdma, sc-sc_txbuf,
tx, ath_txbuf, ATH_TXDESC);
if (error != 0) {
-   ath_descdma_cleanup(sc, sc-sc_rxdma, 

svn commit: r238285 - stable/9/sys/security/mac

2012-07-09 Thread Robert Watson
Author: rwatson
Date: Mon Jul  9 08:42:54 2012
New Revision: 238285
URL: http://svn.freebsd.org/changeset/base/238285

Log:
  Merge r234032 from head to stable/9:
  
When allocation of labels on files is implicitly disabled due to MAC
policy configuration, avoid leaking resources following failed calls
to get and set MAC labels by file descriptor.
  
Reported by:Mateusz Guzik mjguzik at gmail.com + clang scan-build
  
  Approved by:  re (kib)

Modified:
  stable/9/sys/security/mac/mac_syscalls.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/security/mac/mac_syscalls.c
==
--- stable/9/sys/security/mac/mac_syscalls.cMon Jul  9 08:37:59 2012
(r238284)
+++ stable/9/sys/security/mac/mac_syscalls.cMon Jul  9 08:42:54 2012
(r238285)
@@ -256,8 +256,10 @@ sys___mac_get_fd(struct thread *td, stru
switch (fp-f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
-   if (!(mac_labeled  MPC_OBJECT_VNODE))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_VNODE)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
vp = fp-f_vnode;
intlabel = mac_vnode_label_alloc();
vfslocked = VFS_LOCK_GIANT(vp-v_mount);
@@ -271,8 +273,10 @@ sys___mac_get_fd(struct thread *td, stru
break;
 
case DTYPE_PIPE:
-   if (!(mac_labeled  MPC_OBJECT_PIPE))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_PIPE)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
pipe = fp-f_data;
intlabel = mac_pipe_label_alloc();
PIPE_LOCK(pipe);
@@ -284,8 +288,10 @@ sys___mac_get_fd(struct thread *td, stru
break;
 
case DTYPE_SOCKET:
-   if (!(mac_labeled  MPC_OBJECT_SOCKET))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_SOCKET)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
so = fp-f_data;
intlabel = mac_socket_label_alloc(M_WAITOK);
SOCK_LOCK(so);
@@ -299,10 +305,10 @@ sys___mac_get_fd(struct thread *td, stru
default:
error = EINVAL;
}
-   fdrop(fp, td);
if (error == 0)
error = copyout(buffer, mac.m_string, strlen(buffer)+1);
-
+out_fdrop:
+   fdrop(fp, td);
 out:
free(buffer, M_MACTEMP);
free(elements, M_MACTEMP);
@@ -450,8 +456,10 @@ sys___mac_set_fd(struct thread *td, stru
switch (fp-f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
-   if (!(mac_labeled  MPC_OBJECT_VNODE))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_VNODE)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
intlabel = mac_vnode_label_alloc();
error = mac_vnode_internalize_label(intlabel, buffer);
if (error) {
@@ -475,8 +483,10 @@ sys___mac_set_fd(struct thread *td, stru
break;
 
case DTYPE_PIPE:
-   if (!(mac_labeled  MPC_OBJECT_PIPE))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_PIPE)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
intlabel = mac_pipe_label_alloc();
error = mac_pipe_internalize_label(intlabel, buffer);
if (error == 0) {
@@ -490,8 +500,10 @@ sys___mac_set_fd(struct thread *td, stru
break;
 
case DTYPE_SOCKET:
-   if (!(mac_labeled  MPC_OBJECT_SOCKET))
-   return (EINVAL);
+   if (!(mac_labeled  MPC_OBJECT_SOCKET)) {
+   error = EINVAL;
+   goto out_fdrop;
+   }
intlabel = mac_socket_label_alloc(M_WAITOK);
error = mac_socket_internalize_label(intlabel, buffer);
if (error == 0) {
@@ -505,6 +517,7 @@ sys___mac_set_fd(struct thread *td, stru
default:
error = EINVAL;
}
+out_fdrop:
fdrop(fp, td);
 out:
free(buffer, M_MACTEMP);
___
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: r238092 - in head/sys: net netinet netinet6

2012-07-09 Thread Gleb Smirnoff
On Sat, Jul 07, 2012 at 09:36:11PM +, Bjoern A. Zeeb wrote:
B  Author: glebius
B  Date: Wed Jul  4 07:37:53 2012
B  New Revision: 238092
B  URL: http://svn.freebsd.org/changeset/base/238092
B  
B  Log:
B   When ip_output()/ip6_output() is supplied a struct route *ro argument,
B   it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning
B   here: it may be supplied to provide route, and it may be supplied to
B   store and return to caller the route that ip_output()/ip6_output()
B   finds. In the latter case skipping FLOWTABLE lookup is pessimisation.
B  
B   The difference between struct route filled by FLOWTABLE and filled
B   by rtalloc() family is that the former doesn't hold a reference on
B   its rtentry. Reference is hold by flow entry, and it is about to
B   be released in future. Thus, route filled by FLOWTABLE shouldn't
B   be passed to RTFREE() macro.
B  
B   - Introduce new flag for struct route/route_in6, that marks route
B not holding a reference on rtentry.
B   - Introduce new macro RO_RTFREE() that cleans up a struct route
B depending on its kind.
B   - All callers to ip_output()/ip6_output() that do supply non-NULL
B but empty route should use RO_RTFREE() to free results of
B lookup.
B   - ip_output()/ip6_output() now do FLOWTABLE lookup always when
B ro-ro_rt == NULL.
B 
B 
B Just read the description but you realize that the proper fix is to
B make flowtable code a bit slower and do proper reference counting?
B 
B Currently a cache flowtable entry might still be releases while a packet
B in being processed using it, right?

I think we should connect Kip to the discussion. Flowtable is designed to
be fast and lockless, and not refcounting rtentries per packet. Yes, it is
theoretically racy. But my patch didn't bring in anything new to
this pecularity of flowtable.

-- 
Totus tuus, Glebius.
___
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: r238286 - stable/9/lib/libedit

2012-07-09 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul  9 09:11:07 2012
New Revision: 238286
URL: http://svn.freebsd.org/changeset/base/238286

Log:
  MFC   r238173:
  
  Fix issue resizing bin/sh
  
  This partially reverts some changes from r237448 that are causing
  breakage when resizing under bin/sh .
  
  Reverted changes from NetBSD are:
  
  Mar 10 20:46:15 2009 - editline.3 read.c
  make el_gets set the count to -1 on error to distinguish between EOF and
  error.
  
  Feb 19 15:20:22 2009 - read.c sig.c sig.h
  reset and redraw on sigcont. From Anon Ymous.
  
  Feb 15 21:24:13 2009
  don't restart on EINTR, instead return NULL immediately. From Anon Ymous
  
  PR:   169603
  Reported by:  Peter Jeremy, David Shao
  MFC after:3 days
  Approved by:  re

Modified:
  stable/9/lib/libedit/editline.3
  stable/9/lib/libedit/el.h
  stable/9/lib/libedit/read.c
  stable/9/lib/libedit/sig.c
  stable/9/lib/libedit/sig.h
Directory Properties:
  stable/9/lib/libedit/   (props changed)

Modified: stable/9/lib/libedit/editline.3
==
--- stable/9/lib/libedit/editline.3 Mon Jul  9 08:42:54 2012
(r238285)
+++ stable/9/lib/libedit/editline.3 Mon Jul  9 09:11:07 2012
(r238286)
@@ -162,11 +162,6 @@ is modified to contain the number of cha
 Returns the line read if successful, or
 .Dv NULL
 if no characters were read or if an error occurred.
-If an error occurred,
-.Fa count
-is set to \-1 and
-.Dv errno
-contains the error code that caused it.
 The return value may not remain valid across calls to
 .Fn el_gets
 and must be copied if the data is to be retained.

Modified: stable/9/lib/libedit/el.h
==
--- stable/9/lib/libedit/el.h   Mon Jul  9 08:42:54 2012(r238285)
+++ stable/9/lib/libedit/el.h   Mon Jul  9 09:11:07 2012(r238286)
@@ -115,7 +115,6 @@ struct editline {
FILE *el_errfile;   /* Stdio stuff  */
int   el_infd;  /* Input file descriptor*/
int   el_flags; /* Various flags.   */
-   int   el_errno; /* Local copy of errno  */
coord_t   el_cursor;/* Cursor location  */
char**el_display;   /* Real screen image = what is there */
char**el_vdisplay;  /* Virtual screen image = what we see */

Modified: stable/9/lib/libedit/read.c
==
--- stable/9/lib/libedit/read.c Mon Jul  9 08:42:54 2012(r238285)
+++ stable/9/lib/libedit/read.c Mon Jul  9 09:11:07 2012(r238286)
@@ -49,7 +49,7 @@ __FBSDID($FreeBSD$);
 #include stdlib.h
 #include el.h
 
-#defineOKCMD   -1  /* must be -1! */
+#defineOKCMD   -1
 
 private intread__fixio(int, int);
 private intread_preread(EditLine *);
@@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e)
return (e ? 0 : -1);
 
case EINTR:
-   return (-1);
+   return (0);
 
default:
return (-1);
@@ -235,12 +235,9 @@ read_getcmd(EditLine *el, el_action_t *c
el_action_t cmd;
int num;
 
-   el-el_errno = 0;
do {
-   if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */
-   el-el_errno = num == 0 ? 0 : errno;
+   if ((num = el_getc(el, ch)) != 1)   /* if EOF or error */
return (num);
-   }
 
 #ifdef KANJI
if ((*ch  0200)) {
@@ -292,21 +289,14 @@ read_char(EditLine *el, char *cp)
ssize_t num_read;
int tried = 0;
 
- again:
-   el-el_signal-sig_no = 0;
-   while ((num_read = read(el-el_infd, cp, 1)) == -1) {
-   if (el-el_signal-sig_no == SIGCONT) {
-   sig_set(el);
-   el_set(el, EL_REFRESH);
-   goto again;
-   }
+   while ((num_read = read(el-el_infd, cp, 1)) == -1)
if (!tried  read__fixio(el-el_infd, errno) == 0)
tried = 1;
else {
*cp = '\0';
return (-1);
}
-   }
+
return (int)num_read;
 }
 
@@ -413,20 +403,17 @@ el_gets(EditLine *el, int *nread)
int num;/* how many chars we have read at NL */
char ch;
int crlf = 0;
-   int nrb;
 #ifdef FIONREAD
c_macro_t *ma = el-el_chared.c_macro;
 #endif /* FIONREAD */
 
-   if (nread == NULL)
-   nread = nrb;
*nread = 0;
 
if (el-el_flags  NO_TTY) {
char *cp = el-el_line.buffer;
size_t idx;
 
-   while ((num = (*el-el_read.read_char)(el, cp)) == 1) {
+   while ((*el-el_read.read_char)(el, cp) == 1) 

svn commit: r238287 - head/sys/kern

2012-07-09 Thread David Xu
Author: davidxu
Date: Mon Jul  9 09:24:46 2012
New Revision: 238287
URL: http://svn.freebsd.org/changeset/base/238287

Log:
  If you have pressed CTRL+Z and a process is suspended, then you use gdb
  to attach to the process, it is surprising that the process is resumed
  without inputting any gdb commands, however ptrace manual said:
The tracing process will see the newly-traced process stop and may
then control it as if it had been traced all along.
  But the current code does not work in this way, unless traced process
  received a signal later, it will continue to run as a background task.
  To fix this problem, just send signal SIGSTOP to the traced process after
  we resumed it, this works like that you are attaching to a running process,
  it is not perfect but better than nothing.

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==
--- head/sys/kern/sys_process.c Mon Jul  9 09:11:07 2012(r238286)
+++ head/sys/kern/sys_process.c Mon Jul  9 09:24:46 2012(r238287)
@@ -635,7 +635,7 @@ kern_ptrace(struct thread *td, int req, 
struct iovec iov;
struct uio uio;
struct proc *curp, *p, *pp;
-   struct thread *td2 = NULL;
+   struct thread *td2 = NULL, *td3;
struct ptrace_io_desc *piod = NULL;
struct ptrace_lwpinfo *pl;
int error, write, tmp, num;
@@ -953,10 +953,8 @@ kern_ptrace(struct thread *td, int req, 
td2-td_xsig = data;
 
if (req == PT_DETACH) {
-   struct thread *td3;
-   FOREACH_THREAD_IN_PROC(p, td3) {
+   FOREACH_THREAD_IN_PROC(p, td3)
td3-td_dbgflags = ~TDB_SUSPEND; 
-   }
}
/*
 * unsuspend all threads, to not let a thread run,
@@ -967,6 +965,8 @@ kern_ptrace(struct thread *td, int req, 
p-p_flag = ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED);
thread_unsuspend(p);
PROC_SUNLOCK(p);
+   if (req == PT_ATTACH)
+   kern_psignal(p, data);
} else {
if (data)
kern_psignal(p, data);
___
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: r238288 - head/usr.sbin/acpi/acpidump

2012-07-09 Thread Takanori Watanabe
Author: takawata
Date: Mon Jul  9 09:38:53 2012
New Revision: 238288
URL: http://svn.freebsd.org/changeset/base/238288

Log:
  Add range and table revision checking to avoid abend.
  
  PR:bin/169707
  Submitted by:Dan Lukes d...@obluda.cz
  MFC after:3 days.

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Mon Jul  9 09:24:46 2012
(r238287)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Mon Jul  9 09:38:53 2012
(r238288)
@@ -654,16 +654,24 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
printf(END_COMMENT);
return;
}
+   if(sdp-Revision == 1){
+   printf(\tOLD TCPA spec log found. Dumping not supported.\n);
+   printf(END_COMMENT);
+   return;
+   }
 
vaddr = (unsigned char *)acpi_map_physical(paddr, len);
vend = vaddr + len;
 
while (vaddr != NULL) {
-   if (vaddr + sizeof(struct TCPAevent) = vend)
+   if ((vaddr + sizeof(struct TCPAevent) = vend)||
+   (vaddr + sizeof(struct TCPAevent)  vaddr))
break;
event = (struct TCPAevent *)(void *)vaddr;
if (vaddr + event-event_size = vend)
break;
+   if (vaddr + event-event_size  vaddr)
+   break;
if (event-event_type == 0  event-event_size == 0)
break;
 #if 0
___
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: r238289 - head/sys/mips/nlm

2012-07-09 Thread Jayachandran C.
Author: jchandra
Date: Mon Jul  9 10:17:06 2012
New Revision: 238289
URL: http://svn.freebsd.org/changeset/base/238289

Log:
  Fix PCIe hardware swap configuration for Netlogic XLP
  
  The last 12 bits of the limit registers have to be set to 1. These
  bits are not significant in bridge BARs and are 0 on read, but the
  bits are valid in the swap limit register and needs to be set.

Modified:
  head/sys/mips/nlm/xlp_pci.c

Modified: head/sys/mips/nlm/xlp_pci.c
==
--- head/sys/mips/nlm/xlp_pci.c Mon Jul  9 09:38:53 2012(r238288)
+++ head/sys/mips/nlm/xlp_pci.c Mon Jul  9 10:17:06 2012(r238289)
@@ -507,13 +507,13 @@ xlp_pcib_hardware_swap_enable(int node, 
nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_BASE, bar);
 
bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEMEM_LIMIT0 + link);
-   nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_LIM, bar);
+   nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_LIM, bar | 0xFFF);
 
bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEIO_BASE0 + link);
nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_BASE, bar);
 
bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEIO_LIMIT0 + link);
-   nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_LIM, bar);
+   nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_LIM, bar | 0xFFF);
 }
 
 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: r238290 - head/sys/mips/nlm

2012-07-09 Thread Jayachandran C.
Author: jchandra
Date: Mon Jul  9 10:24:45 2012
New Revision: 238290
URL: http://svn.freebsd.org/changeset/base/238290

Log:
  Identify Netlogic XLP 8xx B1 chip revisions
  
  Add functions to check for 8xx B0 and 3xx Ax revisions which will
  be used in network block initialization.

Modified:
  head/sys/mips/nlm/board.c
  head/sys/mips/nlm/xlp.h

Modified: head/sys/mips/nlm/board.c
==
--- head/sys/mips/nlm/board.c   Mon Jul  9 10:17:06 2012(r238289)
+++ head/sys/mips/nlm/board.c   Mon Jul  9 10:24:45 2012(r238290)
@@ -362,6 +362,8 @@ nlm_print_processor_info(void)
revstr = A2; break;
case 3:
revstr = B0; break;
+   case 4:
+   revstr = B1; break;
default:
revstr = ??; break;
}

Modified: head/sys/mips/nlm/xlp.h
==
--- head/sys/mips/nlm/xlp.h Mon Jul  9 10:17:06 2012(r238289)
+++ head/sys/mips/nlm/xlp.h Mon Jul  9 10:24:45 2012(r238290)
@@ -57,6 +57,7 @@
 #defineXLP_REVISION_A1 0x01
 #defineXLP_REVISION_A2 0x02
 #defineXLP_REVISION_B0 0x03
+#defineXLP_REVISION_B1 0x04
 
 #ifndef LOCORE
 /*
@@ -87,6 +88,16 @@ static __inline int nlm_is_xlp3xx(void)
return (nlm_processor_id() == CHIP_PROCESSOR_ID_XLP_3XX);
 }
 
+static __inline int nlm_is_xlp3xx_ax(void)
+{
+   uint32_t procid = mips_rd_prid();
+   int prid = (procid  8)  0xff;
+   int rev = procid  0xff;
+
+   return (prid == CHIP_PROCESSOR_ID_XLP_3XX 
+   rev  XLP_REVISION_B0);
+}
+
 static __inline int nlm_is_xlp4xx(void)
 {
int prid = nlm_processor_id();
@@ -116,5 +127,17 @@ static __inline int nlm_is_xlp8xx_ax(voi
(rev  XLP_REVISION_B0));
 }
 
+static __inline int nlm_is_xlp8xx_b0(void)
+{
+   uint32_t procid = mips_rd_prid();
+   int prid = (procid  8)  0xff;
+   int rev = procid  0xff;
+
+   return ((prid == CHIP_PROCESSOR_ID_XLP_8XX ||
+   prid == CHIP_PROCESSOR_ID_XLP_432 ||
+   prid == CHIP_PROCESSOR_ID_XLP_416) 
+   rev == XLP_REVISION_B0);
+}
+
 #endif /* LOCORE */
 #endif /* __NLM_XLP_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: r238291 - stable/9/usr.bin/xinstall

2012-07-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jul  9 10:33:53 2012
New Revision: 238291
URL: http://svn.freebsd.org/changeset/base/238291

Log:
  MFC r237988:
  Issue proper diagnostic on the short writes, also consider the
  case of write reporting 0 bytes as short write.
  
  Approved by:  re (hrs)

Modified:
  stable/9/usr.bin/xinstall/xinstall.c
Directory Properties:
  stable/9/usr.bin/xinstall/   (props changed)

Modified: stable/9/usr.bin/xinstall/xinstall.c
==
--- stable/9/usr.bin/xinstall/xinstall.cMon Jul  9 10:24:45 2012
(r238290)
+++ stable/9/usr.bin/xinstall/xinstall.cMon Jul  9 10:33:53 2012
(r238291)
@@ -55,6 +55,7 @@ __FBSDID($FreeBSD$);
 #include grp.h
 #include paths.h
 #include pwd.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -670,11 +671,18 @@ copy(int from_fd, const char *from_name,
if (size = 8 * 1048576  trymmap(from_fd) 
(p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED,
from_fd, (off_t)0)) != (char *)MAP_FAILED) {
-   if ((nw = write(to_fd, p, size)) != size) {
+   nw = write(to_fd, p, size);
+   if (nw != size) {
serrno = errno;
(void)unlink(to_name);
-   errno = nw  0 ? EIO : serrno;
-   err(EX_OSERR, %s, to_name);
+   if (nw = 0) {
+   errx(EX_OSERR,
+ short write to %s: %jd bytes written, %jd bytes asked to write,
+   to_name, (uintmax_t)nw, (uintmax_t)size);
+   } else {
+   errno = serrno;
+   err(EX_OSERR, %s, to_name);
+   }
}
done_copy = 1;
}
@@ -683,8 +691,15 @@ copy(int from_fd, const char *from_name,
if ((nw = write(to_fd, buf, nr)) != nr) {
serrno = errno;
(void)unlink(to_name);
-   errno = nw  0 ? EIO : serrno;
-   err(EX_OSERR, %s, to_name);
+   if (nw = 0) {
+   errx(EX_OSERR,
+ short write to %s: %jd bytes written, %jd bytes asked to write,
+   to_name, (uintmax_t)nw,
+   (uintmax_t)size);
+   } else {
+   errno = serrno;
+   err(EX_OSERR, %s, to_name);
+   }
}
if (nr != 0) {
serrno = errno;
___
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: r238292 - stable/8/usr.bin/xinstall

2012-07-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jul  9 10:36:43 2012
New Revision: 238292
URL: http://svn.freebsd.org/changeset/base/238292

Log:
  MFC r237988:
  Issue proper diagnostic on the short writes, also consider the
  case of write reporting 0 bytes as short write.

Modified:
  stable/8/usr.bin/xinstall/xinstall.c
Directory Properties:
  stable/8/usr.bin/xinstall/   (props changed)

Modified: stable/8/usr.bin/xinstall/xinstall.c
==
--- stable/8/usr.bin/xinstall/xinstall.cMon Jul  9 10:33:53 2012
(r238291)
+++ stable/8/usr.bin/xinstall/xinstall.cMon Jul  9 10:36:43 2012
(r238292)
@@ -60,6 +60,7 @@ __FBSDID($FreeBSD$);
 #include grp.h
 #include paths.h
 #include pwd.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -675,11 +676,18 @@ copy(int from_fd, const char *from_name,
if (size = 8 * 1048576  trymmap(from_fd) 
(p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED,
from_fd, (off_t)0)) != (char *)MAP_FAILED) {
-   if ((nw = write(to_fd, p, size)) != size) {
+   nw = write(to_fd, p, size);
+   if (nw != size) {
serrno = errno;
(void)unlink(to_name);
-   errno = nw  0 ? EIO : serrno;
-   err(EX_OSERR, %s, to_name);
+   if (nw = 0) {
+   errx(EX_OSERR,
+ short write to %s: %jd bytes written, %jd bytes asked to write,
+   to_name, (uintmax_t)nw, (uintmax_t)size);
+   } else {
+   errno = serrno;
+   err(EX_OSERR, %s, to_name);
+   }
}
done_copy = 1;
}
@@ -688,8 +696,15 @@ copy(int from_fd, const char *from_name,
if ((nw = write(to_fd, buf, nr)) != nr) {
serrno = errno;
(void)unlink(to_name);
-   errno = nw  0 ? EIO : serrno;
-   err(EX_OSERR, %s, to_name);
+   if (nw = 0) {
+   errx(EX_OSERR,
+ short write to %s: %jd bytes written, %jd bytes asked to write,
+   to_name, (uintmax_t)nw,
+   (uintmax_t)size);
+   } else {
+   errno = serrno;
+   err(EX_OSERR, %s, to_name);
+   }
}
if (nr != 0) {
serrno = errno;
___
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: r238293 - in head/sys/mips/nlm: dev/net hal

2012-07-09 Thread Jayachandran C.
Author: jchandra
Date: Mon Jul  9 10:39:57 2012
New Revision: 238293
URL: http://svn.freebsd.org/changeset/base/238293

Log:
  Support Netlogic XLP 8xx B1 revisions in xlpge.
  
  Updates to the MDIO access code for the new revision of the
  XLP chip.

Modified:
  head/sys/mips/nlm/dev/net/mdio.c
  head/sys/mips/nlm/hal/mdio.h

Modified: head/sys/mips/nlm/dev/net/mdio.c
==
--- head/sys/mips/nlm/dev/net/mdio.cMon Jul  9 10:36:43 2012
(r238292)
+++ head/sys/mips/nlm/dev/net/mdio.cMon Jul  9 10:39:57 2012
(r238293)
@@ -38,6 +38,8 @@ __FBSDID($FreeBSD$);
 #include mips/nlm/hal/nae.h
 #include mips/nlm/hal/mdio.h
 
+#include mips/nlm/xlp.h
+
 /* Internal MDIO READ/WRITE Routines */
 int
 nlm_int_gmac_mdio_read(uint64_t nae_base, int bus, int block,
@@ -176,12 +178,7 @@ nlm_gmac_mdio_read(uint64_t nae_base, in
 int intf_type, int phyaddr, int regidx)
 {
uint32_t mdio_ld_cmd;
-   uint32_t val;
-
-   val = EXT_G_MDIO_CMD_SP |
-   (phyaddr  EXT_G_MDIO_PHYADDR_POS) |
-   (regidx  EXT_G_MDIO_REGADDR_POS) |
-   EXT_G_MDIO_DIV;
+   uint32_t ctrlval;
 
mdio_ld_cmd = nlm_read_nae_reg(nae_base, NAE_REG(block, intf_type,
(EXT_G0_MDIO_CTRL + bus * 4)));
@@ -195,14 +192,22 @@ nlm_gmac_mdio_read(uint64_t nae_base, in
EXT_G_MDIO_STAT_MBSY);
}
 
-   nlm_write_nae_reg(nae_base,
+   ctrlval = EXT_G_MDIO_CMD_SP |
+   (phyaddr  EXT_G_MDIO_PHYADDR_POS) |
+   (regidx  EXT_G_MDIO_REGADDR_POS);
+   if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax())
+   ctrlval |= EXT_G_MDIO_DIV;
+   else
+   ctrlval |= EXT_G_MDIO_DIV_WITH_HW_DIV64;
+
+   nlm_write_nae_reg(nae_base, 
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
-   val);
+   ctrlval);
 
nlm_write_nae_reg(nae_base,
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
-   val | (118));
-
+   ctrlval | (118));
+   DELAY(1000);
/* poll master busy bit until it is not busy */
while(nlm_read_nae_reg(nae_base,
NAE_REG(block, intf_type, (EXT_G0_MDIO_RD_STAT + bus * 4))) 
@@ -210,7 +215,7 @@ nlm_gmac_mdio_read(uint64_t nae_base, in
 
nlm_write_nae_reg(nae_base,
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
-   val);
+   ctrlval);
 
/* Read the data back */
return nlm_read_nae_reg(nae_base,
@@ -236,11 +241,6 @@ nlm_gmac_mdio_write(uint64_t nae_base, i
uint32_t mdio_ld_cmd;
uint32_t ctrlval;
 
-   ctrlval = EXT_G_MDIO_CMD_SP |
-   (phyaddr  EXT_G_MDIO_PHYADDR_POS) |
-   (regidx  EXT_G_MDIO_REGADDR_POS)  |
-   EXT_G_MDIO_DIV;
-
mdio_ld_cmd = nlm_read_nae_reg(nae_base, NAE_REG(block, intf_type,
(EXT_G0_MDIO_CTRL + bus * 4)));
if (mdio_ld_cmd  EXT_G_MDIO_CMD_LCD) {
@@ -258,6 +258,14 @@ nlm_gmac_mdio_write(uint64_t nae_base, i
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL_DATA+bus*4)), 
val);
 
+   ctrlval = EXT_G_MDIO_CMD_SP |
+   (phyaddr  EXT_G_MDIO_PHYADDR_POS) |
+   (regidx  EXT_G_MDIO_REGADDR_POS);
+   if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax())
+   ctrlval |= EXT_G_MDIO_DIV;
+   else
+   ctrlval |= EXT_G_MDIO_DIV_WITH_HW_DIV64;
+
nlm_write_nae_reg(nae_base,
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
ctrlval);
@@ -265,6 +273,7 @@ nlm_gmac_mdio_write(uint64_t nae_base, i
nlm_write_nae_reg(nae_base,
NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
ctrlval | EXT_G_MDIO_CMD_LCD);
+   DELAY(1000);
 
/* poll master busy bit until it is not busy */
while(nlm_read_nae_reg(nae_base,
@@ -291,11 +300,17 @@ int
 nlm_gmac_mdio_reset(uint64_t nae_base, int bus, int block,
 int intf_type)
 {
+   uint32_t ctrlval;
+
+   if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax())
+   ctrlval = EXT_G_MDIO_DIV;
+   else
+   ctrlval = EXT_G_MDIO_DIV_WITH_HW_DIV64;
+
nlm_write_nae_reg(nae_base,
-   NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
-   EXT_G_MDIO_MMRST | EXT_G_MDIO_DIV);
+   NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4)), 
+   EXT_G_MDIO_MMRST | ctrlval);
nlm_write_nae_reg(nae_base,
-   NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), 
-   EXT_G_MDIO_DIV);
+   NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4)), ctrlval);
return (0);
 }

Modified: head/sys/mips/nlm/hal/mdio.h
==
--- head/sys/mips/nlm/hal/mdio.hMon Jul  9 10:36:43 2012
(r238292)

svn commit: r238294 - head/sys/netinet

2012-07-09 Thread Michael Tuexen
Author: tuexen
Date: Mon Jul  9 10:59:39 2012
New Revision: 238294
URL: http://svn.freebsd.org/changeset/base/238294

Log:
  Fix a bug introduced in r237715.
  
  MFC after:i 3 days.

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Mon Jul  9 10:39:57 2012
(r238293)
+++ head/sys/netinet/sctp_output.c  Mon Jul  9 10:59:39 2012
(r238294)
@@ -5520,6 +5520,7 @@ do_a_abort:
case AF_INET6:
{
stc.addr_type = SCTP_IPV6_ADDRESS;
+   memcpy(stc.address, src6-sin6_addr, 
sizeof(struct in6_addr));
stc.scope_id = in6_getscope(src6-sin6_addr);
if (sctp_is_address_on_local_host(src, vrf_id)) 
{
stc.loopback_scope = 1;
___
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: r238295 - stable/9/sys/netgraph/netflow

2012-07-09 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Jul  9 11:53:06 2012
New Revision: 238295
URL: http://svn.freebsd.org/changeset/base/238295

Log:
  Merge r237162, r237163, r237164, r237226.
  
  Fix improper L4 header handling for IPv6 packets passed via DLT_RAW.
  Set netflow v9 observation domain value to fib number instead of node id.
  This fixes multi-fib netflow v9 export.
  Use time_uptime instead of getnanotime for accouting integer number of 
seconds.
  Simplify IP pointer recovery in case of mbuf reallocation.
  
  Approved by: ae(mentor)
  Approved by: re

Modified:
  stable/9/sys/netgraph/netflow/netflow_v9.c
  stable/9/sys/netgraph/netflow/ng_netflow.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netgraph/netflow/netflow_v9.c
==
--- stable/9/sys/netgraph/netflow/netflow_v9.c  Mon Jul  9 10:59:39 2012
(r238294)
+++ stable/9/sys/netgraph/netflow/netflow_v9.c  Mon Jul  9 11:53:06 2012
(r238295)
@@ -222,7 +222,7 @@ export9_send(priv_p priv, fib_export_p f
header-unix_secs  = htonl(ts.tv_sec);
header-seq_num = htonl(atomic_fetchadd_32(fe-flow9_seq, 1));
header-count = htons(t-count);
-   header-source_id = htonl(NG_NODE_ID(priv-node));
+   header-source_id = htonl(fe-domain_id);
 
if (priv-export9 != NULL)
NG_FWD_ITEM_HOOK_FLAGS(error, item, priv-export9, flags);
@@ -416,16 +416,14 @@ get_export9_dgram(priv_p priv, fib_expor
 * Check if we need to insert templates into packet
 */

-   struct timespec ts;
struct netflow_v9_flowset_header*fl;

-   getnanotime(ts);
-   if ((ts.tv_sec = priv-templ_time + fe-templ_last_ts) ||
+   if ((time_uptime = priv-templ_time + fe-templ_last_ts) ||
(fe-sent_packets = priv-templ_packets + 
fe-templ_last_pkt)) {
 
-   atomic_store_rel_32(fe-templ_last_ts, ts.tv_sec);
-   atomic_store_rel_32(fe-templ_last_pkt, 
fe-sent_packets);
-   
+   fe-templ_last_ts = time_uptime;
+   fe-templ_last_pkt = fe-sent_packets;
+
fl = priv-v9_flowsets[0];
m_append(m, ntohs(fl-length), (void *)fl);
t-flow_header = m-m_len;

Modified: stable/9/sys/netgraph/netflow/ng_netflow.c
==
--- stable/9/sys/netgraph/netflow/ng_netflow.c  Mon Jul  9 10:59:39 2012
(r238294)
+++ stable/9/sys/netgraph/netflow/ng_netflow.c  Mon Jul  9 11:53:06 2012
(r238295)
@@ -560,8 +560,8 @@ ng_netflow_rcvdata (hook_p hook, item_p 
struct ip6_hdr *ip6 = NULL;
struct m_tag *mtag;
int pullup_len = 0, off;
-   uint8_t upper_proto = 0, is_frag = 0;
-   int error = 0, bypass = 0, acct = 0;
+   uint8_t acct = 0, bypass = 0, is_frag = 0, upper_proto = 0;
+   int error = 0, l3_off = 0;
unsigned int src_if_index;
caddr_t upper_ptr = NULL;
fib_export_p fe;
@@ -666,6 +666,7 @@ ng_netflow_rcvdata (hook_p hook, item_p 
M_CHECK(sizeof(struct ip));
eh = mtod(m, struct ether_header *);
ip = (struct ip *)(eh + 1);
+   l3_off = sizeof(struct ether_header);
break;
 #ifdef INET6
case ETHERTYPE_IPV6:
@@ -676,6 +677,7 @@ ng_netflow_rcvdata (hook_p hook, item_p 
M_CHECK(sizeof(struct ip6_hdr));
eh = mtod(m, struct ether_header *);
ip6 = (struct ip6_hdr *)(eh + 1);
+   l3_off = sizeof(struct ether_header);
break;
 #endif
case ETHERTYPE_VLAN:
@@ -686,6 +688,7 @@ ng_netflow_rcvdata (hook_p hook, item_p 
sizeof(struct ether_header));
evh = mtod(m, struct ether_vlan_header *);
etype = ntohs(evh-evl_proto);
+   l3_off = sizeof(struct ether_vlan_header);
 
if (etype == ETHERTYPE_IP) {
M_CHECK(sizeof(struct ip));
@@ -707,12 +710,13 @@ ng_netflow_rcvdata (hook_p hook, item_p 
case DLT_RAW:   /* IP packets */
M_CHECK(sizeof(struct ip));
ip = mtod(m, struct ip *);
+   /* l3_off is already zero */
 #ifdef INET6
/* If INET6 is not defined IPv6 packets will be discarded in 
ng_netflow_flow_add() */
if (ip-ip_v == IP6VERSION) {
/* IPv6 packet */
ip = NULL;
-   M_CHECK(sizeof(struct ip6_hdr));
+   M_CHECK(sizeof(struct ip6_hdr) - 

svn commit: r238296 - stable/9/sys/netinet

2012-07-09 Thread Michael Tuexen
Author: tuexen
Date: Mon Jul  9 13:21:49 2012
New Revision: 238296
URL: http://svn.freebsd.org/changeset/base/238296

Log:
  MFC r238121:
  Use CSUM_SCTP_IPV6 for IPv6.
  
  Approved by: re@

Modified:
  stable/9/sys/netinet/sctp_output.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_output.c
==
--- stable/9/sys/netinet/sctp_output.c  Mon Jul  9 11:53:06 2012
(r238295)
+++ stable/9/sys/netinet/sctp_output.c  Mon Jul  9 13:21:49 2012
(r238296)
@@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 #if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
 #else
-   m-m_pkthdr.csum_flags = CSUM_SCTP;
+   m-m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
m-m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
@@ -11120,7 +11120,7 @@ sctp_send_resp_msg(struct mbuf *m, struc
 #if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
 #else
-   mout-m_pkthdr.csum_flags = CSUM_SCTP;
+   mout-m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
mout-m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
 #endif
___
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: r238298 - head/sys/net

2012-07-09 Thread Ed Maste
Author: emaste
Date: Mon Jul  9 14:16:49 2012
New Revision: 238298
URL: http://svn.freebsd.org/changeset/base/238298

Log:
  Restore error handling lost in r191603
  
  This was missed in the change from IFQ_ENQUEUE to if_transmit.
  
  Sponsored by:   ADARA Networks

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cMon Jul  9 13:56:59 2012(r238297)
+++ head/sys/net/if_bridge.cMon Jul  9 14:16:49 2012(r238298)
@@ -1812,7 +1812,7 @@ bridge_enqueue(struct bridge_softc *sc, 
}
 
if (err == 0)
-   dst_ifp-if_transmit(dst_ifp, m);
+   err = dst_ifp-if_transmit(dst_ifp, m);
}
 
if (err == 0) {
___
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: r238172 - head/sys/dev/agp

2012-07-09 Thread John Baldwin
On Saturday, July 07, 2012 10:44:14 am Marcel Moolenaar wrote:
 The commit log states the motivation: developers tend to copy-n-paste without
 truly understanding the subtle differences and may use the Maxmem use in
 agp_i810.c as the wrong precedence. Secondly, also mentioned in the commit
 log, is the use of realmem in agp.c and then Maxmem in agp_i810.c which is
 likely to be confusing. So the change from Maxmem to realmem in agp_i810.c
 prioritizes the avoidance of confusion over pedantic correctness, which we
 all know isn't achievable anyway. Since agp_i810.c is only for amd64, i386
 and pc98, also stated in the commit log, and all of those have dense phys.
 memory, the discrepancy is still within the margin of error.

1GB is a rather large margin IMO.  If agp_i810.c actually cares about the
maximum PA and not the size of RAM, then it should use the correct variable
for this purpose.  The copy-n-paste thing works both ways.  You don't want
someone to use realmem instead of Maxmem elsewhere because they copy-n-paste
the wrong thing from agp_i810.c.  I think the solution is to fix things to
use what the actually need.  In the case of agp_i810.c it sounds like that is
Maxmem.

-- 
John Baldwin
___
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: r238299 - stable/8/lib/libedit

2012-07-09 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jul  9 15:31:05 2012
New Revision: 238299
URL: http://svn.freebsd.org/changeset/base/238299

Log:
  MFC   r238173:
  
  Fix issue resizing bin/sh
  
  This partially reverts some changes from r237448 that are causing
  breakage when resizing under bin/sh .
  
  Reverted changes from NetBSD are:
  
  Mar 10 20:46:15 2009 - editline.3 read.c
  make el_gets set the count to -1 on error to distinguish between EOF and
  error.
  
  Feb 19 15:20:22 2009 - read.c sig.c sig.h
  reset and redraw on sigcont. From Anon Ymous.
  
  Feb 15 21:24:13 2009
  don't restart on EINTR, instead return NULL immediately. From Anon Ymous
  
  Approved by:  re

Modified:
  stable/8/lib/libedit/editline.3
  stable/8/lib/libedit/el.h
  stable/8/lib/libedit/read.c
  stable/8/lib/libedit/sig.c
  stable/8/lib/libedit/sig.h
Directory Properties:
  stable/8/lib/libedit/   (props changed)

Modified: stable/8/lib/libedit/editline.3
==
--- stable/8/lib/libedit/editline.3 Mon Jul  9 14:16:49 2012
(r238298)
+++ stable/8/lib/libedit/editline.3 Mon Jul  9 15:31:05 2012
(r238299)
@@ -165,11 +165,6 @@ is modified to contain the number of cha
 Returns the line read if successful, or
 .Dv NULL
 if no characters were read or if an error occurred.
-If an error occurred,
-.Fa count
-is set to \-1 and
-.Dv errno
-contains the error code that caused it.
 The return value may not remain valid across calls to
 .Fn el_gets
 and must be copied if the data is to be retained.

Modified: stable/8/lib/libedit/el.h
==
--- stable/8/lib/libedit/el.h   Mon Jul  9 14:16:49 2012(r238298)
+++ stable/8/lib/libedit/el.h   Mon Jul  9 15:31:05 2012(r238299)
@@ -115,7 +115,6 @@ struct editline {
FILE *el_errfile;   /* Stdio stuff  */
int   el_infd;  /* Input file descriptor*/
int   el_flags; /* Various flags.   */
-   int   el_errno; /* Local copy of errno  */
coord_t   el_cursor;/* Cursor location  */
char**el_display;   /* Real screen image = what is there */
char**el_vdisplay;  /* Virtual screen image = what we see */

Modified: stable/8/lib/libedit/read.c
==
--- stable/8/lib/libedit/read.c Mon Jul  9 14:16:49 2012(r238298)
+++ stable/8/lib/libedit/read.c Mon Jul  9 15:31:05 2012(r238299)
@@ -49,7 +49,7 @@ __FBSDID($FreeBSD$);
 #include stdlib.h
 #include el.h
 
-#defineOKCMD   -1  /* must be -1! */
+#defineOKCMD   -1
 
 private intread__fixio(int, int);
 private intread_preread(EditLine *);
@@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e)
return (e ? 0 : -1);
 
case EINTR:
-   return (-1);
+   return (0);
 
default:
return (-1);
@@ -235,12 +235,9 @@ read_getcmd(EditLine *el, el_action_t *c
el_action_t cmd;
int num;
 
-   el-el_errno = 0;
do {
-   if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */
-   el-el_errno = num == 0 ? 0 : errno;
+   if ((num = el_getc(el, ch)) != 1)   /* if EOF or error */
return (num);
-   }
 
 #ifdef KANJI
if ((*ch  0200)) {
@@ -292,21 +289,14 @@ read_char(EditLine *el, char *cp)
ssize_t num_read;
int tried = 0;
 
- again:
-   el-el_signal-sig_no = 0;
-   while ((num_read = read(el-el_infd, cp, 1)) == -1) {
-   if (el-el_signal-sig_no == SIGCONT) {
-   sig_set(el);
-   el_set(el, EL_REFRESH);
-   goto again;
-   }
+   while ((num_read = read(el-el_infd, cp, 1)) == -1)
if (!tried  read__fixio(el-el_infd, errno) == 0)
tried = 1;
else {
*cp = '\0';
return (-1);
}
-   }
+
return (int)num_read;
 }
 
@@ -413,20 +403,17 @@ el_gets(EditLine *el, int *nread)
int num;/* how many chars we have read at NL */
char ch;
int crlf = 0;
-   int nrb;
 #ifdef FIONREAD
c_macro_t *ma = el-el_chared.c_macro;
 #endif /* FIONREAD */
 
-   if (nread == NULL)
-   nread = nrb;
*nread = 0;
 
if (el-el_flags  NO_TTY) {
char *cp = el-el_line.buffer;
size_t idx;
 
-   while ((num = (*el-el_read.read_char)(el, cp)) == 1) {
+   while ((*el-el_read.read_char)(el, cp) == 1) {
/* make sure there is space for next character */

svn commit: r238300 - head/usr.sbin/rarpd

2012-07-09 Thread Joel Dahl
Author: joel (doc committer)
Date: Mon Jul  9 15:44:35 2012
New Revision: 238300
URL: http://svn.freebsd.org/changeset/base/238300

Log:
  Remove end of line whitespace.

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

Modified: head/usr.sbin/rarpd/rarpd.8
==
--- head/usr.sbin/rarpd/rarpd.8 Mon Jul  9 15:31:05 2012(r238299)
+++ head/usr.sbin/rarpd/rarpd.8 Mon Jul  9 15:44:35 2012(r238300)
@@ -96,7 +96,7 @@ instead of via
 Run in the foreground.
 .It Fl P
 Specify the pathname of the PID file.
-If not specified, 
+If not specified,
 .Pa /var/run/rarpd.pid
 or
 .Pa /var/run/rarpd.ifname.pid
___
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: r238301 - head/sys/dev/agp

2012-07-09 Thread Marcel Moolenaar
Author: marcel
Date: Mon Jul  9 16:23:59 2012
New Revision: 238301
URL: http://svn.freebsd.org/changeset/base/238301

Log:
  Revert revision 238172 of agp_i810.c.  Correctness is considered more
  important than avoiding confusion.
  
  Feedback from: kib, jhb

Modified:
  head/sys/dev/agp/agp_i810.c

Modified: head/sys/dev/agp/agp_i810.c
==
--- head/sys/dev/agp/agp_i810.c Mon Jul  9 15:44:35 2012(r238300)
+++ head/sys/dev/agp/agp_i810.c Mon Jul  9 16:23:59 2012(r238301)
@@ -74,6 +74,7 @@ __FBSDID($FreeBSD$);
 
 #include machine/bus.h
 #include machine/resource.h
+#include machine/md_var.h
 #include sys/rman.h
 
 MALLOC_DECLARE(M_AGP);
@@ -1438,7 +1439,7 @@ agp_i810_attach(device_t dev)
if (error)
return (error);
 
-   if (ptoa((vm_paddr_t)realmem) 
+   if (ptoa((vm_paddr_t)Maxmem) 
(1ULL  sc-match-driver-busdma_addr_mask_sz) - 1) {
device_printf(dev, agp_i810 does not support physical 
memory above %ju.\n, (uintmax_t)(1ULL 
___
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: r238302 - in stable/9/sys/dev: cxgb cxgbe

2012-07-09 Thread Navdeep Parhar
Author: np
Date: Mon Jul  9 17:25:56 2012
New Revision: 238302
URL: http://svn.freebsd.org/changeset/base/238302

Log:
  Re-enable IFCAP_TSO6 in cxgb(4) and cxgbe(4) in stable/9.  The kernel
  changes needed for all this to work have now been MFC'd to 9 by bz@.
  
  This is a direct commit to stable/9 that removes earlier changes made to
  drivers in this branch only.
  
  Approved by:  re (kib)

Modified:
  stable/9/sys/dev/cxgb/cxgb_adapter.h
  stable/9/sys/dev/cxgb/cxgb_main.c
  stable/9/sys/dev/cxgbe/adapter.h
  stable/9/sys/dev/cxgbe/t4_main.c

Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h
==
--- stable/9/sys/dev/cxgb/cxgb_adapter.hMon Jul  9 16:23:59 2012
(r238301)
+++ stable/9/sys/dev/cxgb/cxgb_adapter.hMon Jul  9 17:25:56 2012
(r238302)
@@ -81,15 +81,6 @@ extern int cxgb_debug;
 #define MTX_DESTROY mtx_destroy
 #endif
 
-#ifndef IFCAP_HWCSUM_IPV6
-#define IFCAP_HWCSUM_IPV6 0
-#define CSUM_TCP_IPV6 0
-#define CSUM_UDP_IPV6 0
-#define IFCAP_TXCSUM_IPV6 0
-#define IFCAP_RXCSUM_IPV6 0
-#define CSUM_DATA_VALID_IPV6 0
-#endif
-
 enum {
LF_NO = 0,
LF_MAYBE,

Modified: stable/9/sys/dev/cxgb/cxgb_main.c
==
--- stable/9/sys/dev/cxgb/cxgb_main.c   Mon Jul  9 16:23:59 2012
(r238301)
+++ stable/9/sys/dev/cxgb/cxgb_main.c   Mon Jul  9 17:25:56 2012
(r238302)
@@ -987,7 +987,7 @@ cxgb_makedev(struct port_info *pi)
 #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
 IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6)
-#define CXGB_CAP_ENABLE (CXGB_CAP  ~IFCAP_TSO6)
+#define CXGB_CAP_ENABLE (CXGB_CAP)
 
 static int
 cxgb_port_attach(device_t dev)

Modified: stable/9/sys/dev/cxgbe/adapter.h
==
--- stable/9/sys/dev/cxgbe/adapter.hMon Jul  9 16:23:59 2012
(r238301)
+++ stable/9/sys/dev/cxgbe/adapter.hMon Jul  9 17:25:56 2012
(r238302)
@@ -57,15 +57,6 @@ MALLOC_DECLARE(M_CXGBE);
 #define CXGBE_UNIMPLEMENTED(s) \
 panic(%s (%s, line %d) not implemented yet., s, __FILE__, __LINE__)
 
-#ifndef IFCAP_HWCSUM_IPV6
-#define IFCAP_HWCSUM_IPV6 0
-#define CSUM_TCP_IPV6 0
-#define CSUM_UDP_IPV6 0
-#define IFCAP_TXCSUM_IPV6 0
-#define IFCAP_RXCSUM_IPV6 0
-#define CSUM_DATA_VALID_IPV6 0
-#endif
-
 #if defined(__i386__) || defined(__amd64__)
 static __inline void
 prefetch(void *x)

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==
--- stable/9/sys/dev/cxgbe/t4_main.cMon Jul  9 16:23:59 2012
(r238301)
+++ stable/9/sys/dev/cxgbe/t4_main.cMon Jul  9 17:25:56 2012
(r238302)
@@ -824,7 +824,7 @@ cxgbe_probe(device_t dev)
 #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
 IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6)
-#define T4_CAP_ENABLE (T4_CAP  ~IFCAP_TSO6)
+#define T4_CAP_ENABLE (T4_CAP)
 
 static int
 cxgbe_attach(device_t 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


Re: svn commit: r238213 - head/sys/geom

2012-07-09 Thread Pawel Jakub Dawidek
On Mon, Jul 09, 2012 at 09:19:29AM +0200, Edward Tomasz Napierała wrote:
 Look, I really appreciate you're looking at this just six months after
 explicitly refusing to talk to me about the design, but it would be great
 if it was a _technical_ discussion.

As you know I'm not going to be neither nice nor helpful to you.
Just wanted to point out your changes are wrong. That's all I can do.
This is my last e-mail on the subject.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpjEHhwVTWS9.pgp
Description: PGP signature


svn commit: r238308 - head/etc

2012-07-09 Thread Hiroki Sato
Author: hrs
Date: Mon Jul  9 20:11:32 2012
New Revision: 238308
URL: http://svn.freebsd.org/changeset/base/238308

Log:
  Fix a missing ;.

Modified:
  head/etc/devd.conf

Modified: head/etc/devd.conf
==
--- head/etc/devd.conf  Mon Jul  9 19:27:48 2012(r238307)
+++ head/etc/devd.conf  Mon Jul  9 20:11:32 2012(r238308)
@@ -320,7 +320,7 @@ notify 10 {
 notify 0 {
match system  RCTL;
match ruleuser:70:swap:.*;
-   action  /usr/local/etc/rc.d/postgresql restart
+   action  /usr/local/etc/rc.d/postgresql restart;
 };
 
 */
___
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: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw

2012-07-09 Thread Hiroki Sato
Alexander V. Chernikov melif...@freebsd.org wrote
  in 4ffa9723.5000...@freebsd.org:

me On 09.07.2012 12:08, Hiroki Sato wrote:
me  Alexander V. Chernikovmelif...@freebsd.org  wrote
me in4ffa894d.9050...@freebsd.org:
me 
meI meant there was no strong objection.  I am sorry for not commenting
meyour implementation, but at least for ipfw0 it is difficult to
medecouple ifnet and bpf because the primary consumer is tcpdump(8),
mewhich depends on NET_RT_IFLIST to find the target.  Probably your
me tcpdump -i still works with interface name supplied.
mesolution can be used for usbdump(8).  The reason why I committed the
mepatch now is there are reports that these pseudo interfaces made some
meapplications confused and/or caused some performance degradation on
me9.0R, and wanted to fix it in some way.
me Do you plan to take this to 9.1 ?

 Originally I thought of it but I think it was too late.  It should be
 polished in -CURRENT for a while also in terms of how to hide the
 interfaces.

meI am still open for more sophisticated implementation and have no
meobjection to replace mine with it.  Do you have an idea about
meconverting it with a loadable module?
me Personally I think that the right way is to add userkernel interface
me for requesting interface list since this is the most major stopper for
me doing BPF-only providers. However this should be discussed with
me rpaulo@ and delphij@ (so most probably this skips 9.1).

 Adding a sysctl to list all of the struct bpf_if including ones with
 a fake ifp?

 Hm, my goal was just to hide usbusN and ipfw0 *by default* but there
 was no problem with having ipfw0 with an ifnet.  I thought having
 ifnet was tolerable if its consumer was tcpdump-like one because
 there are a lot of packet dump utilities which obtain interface names
 from the system's network interface list.  Hiding the interface is
 rather confusing from user's perspective.

 I do not stick to the committed code and have no objection about
 adding a new API if it is useful.  Well, please let me check if I
 understand your idea correctly.  Given that we add a new API to
 enumerate the interfaces including bpf-only providers with fake
 ifnets, which providers/utilities should be converted to use it?  IMO
 usbusN would be a reasonable target but others still need a real
 ifnet.  In my understanding, the advantage of using a fake ifnet is
 just to prevent it from appearing as an interface.  Is it correct?

me And, as fallback solution we can probably add separate ipfwlog module
me which is quite easy but much less clean.

 I think whether having it as a kernel module or not is orthogonal to
 hiding the interface.  If we support multiple instances of the pseudo
 interface (typical in a system with vnet), cloning capability is
 needed in any way.

-- Hiroki


pgp6BTQLuYxbh.pgp
Description: PGP signature


svn commit: r238309 - head/sys/net

2012-07-09 Thread Mikolaj Golub
Author: trociny
Date: Mon Jul  9 20:38:18 2012
New Revision: 238309
URL: http://svn.freebsd.org/changeset/base/238309

Log:
  In epair_clone_destroy(), when destroying the second half, we have to
  switch to its vnet before calling ether_ifdetach(). Otherwise if the
  second half resides in a different vnet, if_detach() silently fails
  leaving a stale pointer in V_ifnet list, and the system crashes trying
  to access this pointer later.
  
  Another solution could be not to allow to destroy epair unless both
  ends are in the home vnet.
  
  Discussed with:   bz
  Tested by:delphij

Modified:
  head/sys/net/if_epair.c

Modified: head/sys/net/if_epair.c
==
--- head/sys/net/if_epair.c Mon Jul  9 20:11:32 2012(r238308)
+++ head/sys/net/if_epair.c Mon Jul  9 20:38:18 2012(r238309)
@@ -904,39 +904,41 @@ epair_clone_destroy(struct if_clone *ifc
if_link_state_change(oifp, LINK_STATE_DOWN);
ifp-if_drv_flags = ~IFF_DRV_RUNNING;
oifp-if_drv_flags = ~IFF_DRV_RUNNING;
+
+   /*
+* Get rid of our second half. As the other of the two
+* interfaces may reside in a different vnet, we need to
+* switch before freeing them.
+*/
+   CURVNET_SET_QUIET(oifp-if_vnet);
ether_ifdetach(oifp);
-   ether_ifdetach(ifp);
/*
 * Wait for all packets to be dispatched to if_input.
-* The numbers can only go down as the interfaces are
+* The numbers can only go down as the interface is
 * detached so there is no need to use atomics.
 */
-   DPRINTF(sca refcnt=%u scb refcnt=%u\n, sca-refcount, scb-refcount);
-   EPAIR_REFCOUNT_ASSERT(sca-refcount == 1  scb-refcount == 1,
-   (%s: ifp=%p sca-refcount!=1: %d || ifp=%p scb-refcount!=1: %d,
-   __func__, ifp, sca-refcount, oifp, scb-refcount));
-
-   /*
-* Get rid of our second half.
-*/
+   DPRINTF(scb refcnt=%u\n, scb-refcount);
+   EPAIR_REFCOUNT_ASSERT(scb-refcount == 1,
+   (%s: ifp=%p scb-refcount!=1: %d, __func__, oifp, scb-refcount));
oifp-if_softc = NULL;
error = if_clone_destroyif(ifc, oifp);
if (error)
panic(%s: if_clone_destroyif() for our 2nd iface failed: %d,
__func__, error);
+   if_free(oifp);
+   ifmedia_removeall(scb-media);
+   free(scb, M_EPAIR);
+   CURVNET_RESTORE();
 
+   ether_ifdetach(ifp);
/*
-* Finish cleaning up. Free them and release the unit.
-* As the other of the two interfaces my reside in a different vnet,
-* we need to switch before freeing them.
+* Wait for all packets to be dispatched to if_input.
 */
-   CURVNET_SET_QUIET(oifp-if_vnet);
-   if_free(oifp);
-   CURVNET_RESTORE();
+   DPRINTF(sca refcnt=%u\n, sca-refcount);
+   EPAIR_REFCOUNT_ASSERT(sca-refcount == 1,
+   (%s: ifp=%p sca-refcount!=1: %d, __func__, ifp, sca-refcount));
if_free(ifp);
ifmedia_removeall(sca-media);
-   ifmedia_removeall(scb-media);
-   free(scb, M_EPAIR);
free(sca, M_EPAIR);
ifc_free_unit(ifc, unit);
 
___
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: r238310 - in head/sys: amd64/amd64 i386/i386 pc98/pc98

2012-07-09 Thread John Baldwin
Author: jhb
Date: Mon Jul  9 20:42:08 2012
New Revision: 238310
URL: http://svn.freebsd.org/changeset/base/238310

Log:
  Partially revert r217515 so that the mem_range_softc variable is always
  present on x86 kernels.  This fixes the build of kernels that include
  'device acpi' but do not include 'device mem'.
  
  MFC after:1 month

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mem.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mem.c
  head/sys/pc98/pc98/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Mon Jul  9 20:38:18 2012
(r238309)
+++ head/sys/amd64/amd64/machdep.c  Mon Jul  9 20:42:08 2012
(r238310)
@@ -74,6 +74,7 @@ __FBSDID($FreeBSD$);
 #include sys/linker.h
 #include sys/lock.h
 #include sys/malloc.h
+#include sys/memrange.h
 #include sys/msgbuf.h
 #include sys/mutex.h
 #include sys/pcpu.h
@@ -206,6 +207,8 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
+struct mem_range_softc mem_range_softc;
+
 struct mtx dt_lock;/* lock for GDT and LDT */
 
 static void

Modified: head/sys/amd64/amd64/mem.c
==
--- head/sys/amd64/amd64/mem.c  Mon Jul  9 20:38:18 2012(r238309)
+++ head/sys/amd64/amd64/mem.c  Mon Jul  9 20:42:08 2012(r238310)
@@ -72,8 +72,6 @@ __FBSDID($FreeBSD$);
  */
 MALLOC_DEFINE(M_MEMDESC, memdesc, memory range descriptors);
 
-struct mem_range_softc mem_range_softc;
-
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cMon Jul  9 20:38:18 2012
(r238309)
+++ head/sys/i386/i386/machdep.cMon Jul  9 20:42:08 2012
(r238310)
@@ -75,6 +75,7 @@ __FBSDID($FreeBSD$);
 #include sys/linker.h
 #include sys/lock.h
 #include sys/malloc.h
+#include sys/memrange.h
 #include sys/msgbuf.h
 #include sys/mutex.h
 #include sys/pcpu.h
@@ -247,6 +248,8 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
+struct mem_range_softc mem_range_softc;
+
 static void
 cpu_startup(dummy)
void *dummy;

Modified: head/sys/i386/i386/mem.c
==
--- head/sys/i386/i386/mem.cMon Jul  9 20:38:18 2012(r238309)
+++ head/sys/i386/i386/mem.cMon Jul  9 20:42:08 2012(r238310)
@@ -72,8 +72,6 @@ __FBSDID($FreeBSD$);
  */
 MALLOC_DEFINE(M_MEMDESC, memdesc, memory range descriptors);
 
-struct mem_range_softc mem_range_softc;
-
 static struct sx memsxlock;
 SX_SYSINIT(memsxlockinit, memsxlock, /dev/mem lock);
 

Modified: head/sys/pc98/pc98/machdep.c
==
--- head/sys/pc98/pc98/machdep.cMon Jul  9 20:38:18 2012
(r238309)
+++ head/sys/pc98/pc98/machdep.cMon Jul  9 20:42:08 2012
(r238310)
@@ -73,6 +73,7 @@ __FBSDID($FreeBSD$);
 #include sys/linker.h
 #include sys/lock.h
 #include sys/malloc.h
+#include sys/memrange.h
 #include sys/msgbuf.h
 #include sys/mutex.h
 #include sys/pcpu.h
@@ -216,6 +217,8 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
+struct mem_range_softc mem_range_softc;
+
 static void
 cpu_startup(dummy)
void *dummy;
___
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: r238309 - head/sys/net

2012-07-09 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 07/09/12 13:38, Mikolaj Golub wrote:
 Author: trociny Date: Mon Jul  9 20:38:18 2012 New Revision:
 238309 URL: http://svn.freebsd.org/changeset/base/238309
 
 Log: In epair_clone_destroy(), when destroying the second half, we
 have to switch to its vnet before calling ether_ifdetach().
 Otherwise if the second half resides in a different vnet,
 if_detach() silently fails leaving a stale pointer in V_ifnet list,
 and the system crashes trying to access this pointer later.
 
 Another solution could be not to allow to destroy epair unless
 both ends are in the home vnet.
 
 Discussed with:   bz Tested by:   delphij

Thanks!

Since this affects RELENG_9 and RELENG_8, could you please also MFC
after a settle period?

Cheers,
- -- 
Xin LI delp...@delphij.nethttps://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (FreeBSD)

iQEcBAEBCAAGBQJP+0PMAAoJEG80Jeu8UPuz/ugH/2RmmdfCapeP9eQkIPkaImpm
D5ghJ0fS6dOM87i5QY6c0rJU2TrcLZHkZGnuYv+BSMqCz5de8dw9s7UMM6sHLL92
i4tgpDE2DQxM4b5skR7yCBRES6IAiY6kDIgVskaS95PxA9wuJA4ohqS8pQ5Tp6h4
lM2urad7+FpYGLZRTWY2yOzgS/g2JZNEGSX6tPIAhg8xX1hryP869zjjHJGd4932
X6pPyRtNdTHB69t00UiVMbJPzcSLtue4ECTms0xCPKC7t0+VZXgiYWOJlNnPQYzy
lUkcYy8ZIyUUTD0duOdyun4oQ7xNEdZgZxcRI0Ids68AQs2xUoddL0IyX1ZMe9w=
=kSZl
-END PGP SIGNATURE-
___
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: r238311 - in head/sys: amd64/amd64 amd64/include i386/include i386/isa

2012-07-09 Thread John Baldwin
Author: jhb
Date: Mon Jul  9 20:55:39 2012
New Revision: 238311
URL: http://svn.freebsd.org/changeset/base/238311

Log:
  Add a clts() wrapper around the 'clts' instruction to machine/cpufunc.h
  on x86 and use that to implement stop_emulating() in the fpu/npx code.
  Reimplement start_emulating() in the non-XEN case by using load_cr0() and
  rcr0() instead of the 'lmsw' and 'smsw' instructions.  Intel explicitly
  discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in
  the description of these instructions in Volume 2 of the ADM.
  
  Reviewed by:  kib
  MFC after:1 month

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/amd64/include/cpufunc.h
  head/sys/i386/include/cpufunc.h
  head/sys/i386/isa/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Mon Jul  9 20:42:08 2012(r238310)
+++ head/sys/amd64/amd64/fpu.c  Mon Jul  9 20:55:39 2012(r238311)
@@ -73,10 +73,6 @@ __FBSDID($FreeBSD$);
 #definefxrstor(addr)   __asm __volatile(fxrstor %0 : : m 
(*(addr)))
 #definefxsave(addr)__asm __volatile(fxsave %0 : =m 
(*(addr)))
 #defineldmxcsr(csr)__asm __volatile(ldmxcsr %0 : : m 
(csr))
-#definestart_emulating()   __asm __volatile( \
-   smsw %%ax; orb %0,%%al; lmsw %%ax \
-   : : n (CR0_TS) : ax)
-#definestop_emulating()__asm __volatile(clts)
 
 static __inline void
 xrstor(char *addr, uint64_t mask)
@@ -109,13 +105,14 @@ void  fnstsw(caddr_t addr);
 void   fxsave(caddr_t addr);
 void   fxrstor(caddr_t addr);
 void   ldmxcsr(u_int csr);
-void   start_emulating(void);
-void   stop_emulating(void);
 void   xrstor(char *addr, uint64_t mask);
 void   xsave(char *addr, uint64_t mask);
 
 #endif /* __GNUCLIKE_ASM  !lint */
 
+#definestart_emulating()   load_cr0(rcr0() | CR0_TS)
+#definestop_emulating()clts()
+
 #define GET_FPU_CW(thread) ((thread)-td_pcb-pcb_save-sv_env.en_cw)
 #define GET_FPU_SW(thread) ((thread)-td_pcb-pcb_save-sv_env.en_sw)
 

Modified: head/sys/amd64/include/cpufunc.h
==
--- head/sys/amd64/include/cpufunc.hMon Jul  9 20:42:08 2012
(r238310)
+++ head/sys/amd64/include/cpufunc.hMon Jul  9 20:55:39 2012
(r238311)
@@ -107,6 +107,13 @@ clflush(u_long addr)
 }
 
 static __inline void
+clts(void)
+{
+
+   __asm __volatile(clts);
+}
+
+static __inline void
 disable_intr(void)
 {
__asm __volatile(cli : : : memory);
@@ -702,6 +709,9 @@ intr_restore(register_t rflags)
 intbreakpoint(void);
 u_int  bsfl(u_int mask);
 u_int  bsrl(u_int mask);
+void   clflush(u_long addr);
+void   clts(void);
+void   cpuid_count(u_int ax, u_int cx, u_int *p);
 void   disable_intr(void);
 void   do_cpuid(u_int ax, u_int *p);
 void   enable_intr(void);

Modified: head/sys/i386/include/cpufunc.h
==
--- head/sys/i386/include/cpufunc.h Mon Jul  9 20:42:08 2012
(r238310)
+++ head/sys/i386/include/cpufunc.h Mon Jul  9 20:55:39 2012
(r238311)
@@ -97,6 +97,13 @@ clflush(u_long addr)
 }
 
 static __inline void
+clts(void)
+{
+
+   __asm __volatile(clts);
+}
+
+static __inline void
 disable_intr(void)
 {
 #ifdef XEN
@@ -688,6 +695,9 @@ intr_restore(register_t eflags)
 intbreakpoint(void);
 u_int  bsfl(u_int mask);
 u_int  bsrl(u_int mask);
+void   clflush(u_long addr);
+void   clts(void);
+void   cpuid_count(u_int ax, u_int cx, u_int *p);
 void   disable_intr(void);
 void   do_cpuid(u_int ax, u_int *p);
 void   enable_intr(void);

Modified: head/sys/i386/isa/npx.c
==
--- head/sys/i386/isa/npx.c Mon Jul  9 20:42:08 2012(r238310)
+++ head/sys/i386/isa/npx.c Mon Jul  9 20:55:39 2012(r238311)
@@ -100,15 +100,6 @@ __FBSDID($FreeBSD$);
 #definefxrstor(addr)   __asm __volatile(fxrstor %0 : : m 
(*(addr)))
 #definefxsave(addr)__asm __volatile(fxsave %0 : =m 
(*(addr)))
 #endif
-#ifdef XEN
-#definestart_emulating()   (HYPERVISOR_fpu_taskswitch(1))
-#definestop_emulating()(HYPERVISOR_fpu_taskswitch(0))
-#else
-#definestart_emulating()   __asm __volatile( \
-   smsw %%ax; orb %0,%%al; lmsw %%ax \
-   : : n (CR0_TS) : ax)
-#definestop_emulating()__asm __volatile(clts)
-#endif
 #else  /* !(__GNUCLIKE_ASM  !lint) */
 
 void   fldcw(u_short cw);
@@ -123,11 +114,17 @@ void  frstor(caddr_t addr);
 void   fxsave(caddr_t addr);
 void   fxrstor(caddr_t addr);
 #endif
-void   start_emulating(void);
-void   stop_emulating(void);
 
 #endif /* __GNUCLIKE_ASM  !lint */
 

Re: svn commit: r238309 - head/sys/net

2012-07-09 Thread Mikolaj Golub

On Mon, 09 Jul 2012 13:49:17 -0700 Xin Li wrote:

 XL On 07/09/12 13:38, Mikolaj Golub wrote:
  Author: trociny Date: Mon Jul  9 20:38:18 2012 New Revision:
  238309 URL: http://svn.freebsd.org/changeset/base/238309
  
  Log: In epair_clone_destroy(), when destroying the second half, we
  have to switch to its vnet before calling ether_ifdetach().
  Otherwise if the second half resides in a different vnet,
  if_detach() silently fails leaving a stale pointer in V_ifnet list,
  and the system crashes trying to access this pointer later.
  
  Another solution could be not to allow to destroy epair unless
  both ends are in the home vnet.
  
  Discussed with:bz Tested by:delphij

 XL Thanks!

 XL Since this affects RELENG_9 and RELENG_8, could you please also MFC
 XL after a settle period?

Sure. Just forgot to add the 'MFC after' reminder. I am going to MFC it after
stable/9 unfreeze unless someone really wants it in 9.1 and tests it a
little. This does not look like a critical issue because of the existing
workaround (which can be considered as a best practice): move both ends to the
home vnet before destroying the epair.

-- 
Mikolaj Golub
___
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: r238313 - head/sys/dev/cxgbe

2012-07-09 Thread Navdeep Parhar
Author: np
Date: Mon Jul  9 21:53:50 2012
New Revision: 238313
URL: http://svn.freebsd.org/changeset/base/238313

Log:
  Fix a bug in code that calculates the number of the first interrupt
  vector for a port.  This affected the gigabit ports of T422 cards (the
  ones with 2x10G ports and 2x1G ports).
  
  MFC after:will check with re@

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jul  9 21:46:07 2012(r238312)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jul  9 21:53:50 2012(r238313)
@@ -401,14 +401,16 @@ first_vector(struct port_info *pi)
return (0);
 
for_each_port(sc, i) {
+   struct port_info *p = sc-port[i];
+
if (i == pi-port_id)
break;
 
 #ifdef TCP_OFFLOAD
if (sc-flags  INTR_DIRECT)
-   rc += pi-nrxq + pi-nofldrxq;
+   rc += p-nrxq + p-nofldrxq;
else
-   rc += max(pi-nrxq, pi-nofldrxq);
+   rc += max(p-nrxq, p-nofldrxq);
 #else
/*
 * Not compiled with offload support and intr_count  1.  Only
@@ -419,7 +421,7 @@ first_vector(struct port_info *pi)
(%s: intr_count %d, !INTR_DIRECT, __func__,
sc-intr_count));
 
-   rc += pi-nrxq;
+   rc += p-nrxq;
 #endif
}
 
___
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: r238314 - head/sys/dev/ath/ath_hal

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  9 23:58:22 2012
New Revision: 238314
URL: http://svn.freebsd.org/changeset/base/238314

Log:
  Add some AR9300 HAL descriptor definition changes.
  
  * Add a couple of RX errors;
  * Add the spectral scan PHY error code;
  * extend the RX flags to be a 16 bit field, rather than an 8 bit field;
  * Add a new RX flag.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ah_desc.h

Modified: head/sys/dev/ath/ath_hal/ah_desc.h
==
--- head/sys/dev/ath/ath_hal/ah_desc.h  Mon Jul  9 21:53:50 2012
(r238313)
+++ head/sys/dev/ath/ath_hal/ah_desc.h  Mon Jul  9 23:58:22 2012
(r238314)
@@ -122,11 +122,12 @@ struct ath_rx_status {
int8_t  rs_rssi_ext[3]; /* rx frame RSSI [ext, chain 0-2] */
uint8_t rs_isaggr;  /* is part of the aggregate */
uint8_t rs_moreaggr;/* more frames in aggr to follow */
+   uint16_trs_flags;   /* misc flags */
uint8_t rs_num_delims;  /* number of delims in aggr */
-   uint8_t rs_flags;   /* misc flags */
+   uint8_t rs_spare0;  /* padding */
uint32_trs_evm0;/* evm bytes */
uint32_trs_evm1;
-   uint32_trs_evm2;
+   uint32_trs_evm2;
uint32_trs_evm3;/* needed for ar9300 and later */
uint32_trs_evm4;/* needed for ar9300 and later */
 #endif /* AH_SUPPORT_AR5416 */
@@ -138,16 +139,19 @@ struct ath_rx_status {
 #defineHAL_RXERR_FIFO  0x04/* fifo overrun */
 #defineHAL_RXERR_DECRYPT   0x08/* non-Michael decrypt error */
 #defineHAL_RXERR_MIC   0x10/* Michael MIC decrypt error */
+#defineHAL_RXERR_INCOMP0x20/* Rx Desc processing is 
incomplete */
+#defineHAL_RXERR_KEYMISS   0x40/* Key not found in keycache */
 
 /* bits found in rs_flags */
-#defineHAL_RX_MORE 0x01/* more descriptors follow */
-#defineHAL_RX_MORE_AGGR0x02/* more frames in aggr */
-#defineHAL_RX_GI   0x04/* full gi */
-#defineHAL_RX_2040 0x08/* 40 Mhz */
-#defineHAL_RX_DELIM_CRC_PRE0x10/* crc error in delimiter pre */
-#defineHAL_RX_DELIM_CRC_POST   0x20/* crc error in delim after */
-#defineHAL_RX_DECRYPT_BUSY 0x40/* decrypt was too slow */
-#defineHAL_RX_HI_RX_CHAIN  0x80/* SM power save: hi Rx chain 
control */
+#defineHAL_RX_MORE 0x0001  /* more descriptors follow */
+#defineHAL_RX_MORE_AGGR0x0002  /* more frames in aggr */
+#defineHAL_RX_GI   0x0004  /* full gi */
+#defineHAL_RX_2040 0x0008  /* 40 Mhz */
+#defineHAL_RX_DELIM_CRC_PRE0x0010  /* crc error in delimiter pre */
+#defineHAL_RX_DELIM_CRC_POST   0x0020  /* crc error in delim after */
+#defineHAL_RX_DECRYPT_BUSY 0x0040  /* decrypt was too slow */
+#defineHAL_RX_HI_RX_CHAIN  0x0080  /* SM power save: hi Rx chain 
control */
+#defineHAL_RX_IS_APSD  0x0100  /* Is ASPD trigger frame */
 
 enum {
HAL_PHYERR_UNDERRUN = 0,/* Transmit underrun */
@@ -178,6 +182,8 @@ enum {
HAL_PHYERR_HT_CRC_ERROR = 34,   /* */
HAL_PHYERR_HT_LENGTH_ILLEGAL= 35,   /* */
HAL_PHYERR_HT_RATE_ILLEGAL  = 36,   /* */
+
+   HAL_PHYERR_SPECTRAL = 38,
 };
 
 /* value found in rs_keyix to mark invalid entries */
___
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: r238315 - head/sys/fs/ntfs

2012-07-09 Thread Attilio Rao
Author: attilio
Date: Tue Jul 10 00:01:00 2012
New Revision: 238315
URL: http://svn.freebsd.org/changeset/base/238315

Log:
  - Remove the unused and not completed write support for NTFS.
  - Fix a bug where vfs_mountedfrom() is called also when the filesystem
is not mounted successfully.
  
  Tested by:pho

Modified:
  head/sys/fs/ntfs/ntfs_subr.c
  head/sys/fs/ntfs/ntfs_subr.h
  head/sys/fs/ntfs/ntfs_vfsops.c
  head/sys/fs/ntfs/ntfs_vnops.c

Modified: head/sys/fs/ntfs/ntfs_subr.c
==
--- head/sys/fs/ntfs/ntfs_subr.cMon Jul  9 23:58:22 2012
(r238314)
+++ head/sys/fs/ntfs/ntfs_subr.cTue Jul 10 00:01:00 2012
(r238315)
@@ -1353,174 +1353,6 @@ ntfs_filesize(
 }
 
 /*
- * This is one of write routine.
- */
-int
-ntfs_writeattr_plain(
-   struct ntfsmount * ntmp,
-   struct ntnode * ip,
-   u_int32_t attrnum,  
-   char *attrname,
-   off_t roff,
-   size_t rsize,
-   void *rdata,
-   size_t * initp,
-   struct uio *uio)
-{
-   size_t  init;
-   int error = 0;
-   off_t   off = roff, left = rsize, towrite;
-   caddr_t data = rdata;
-   struct ntvattr *vap;
-   *initp = 0;
-
-   while (left) {
-   error = ntfs_ntvattrget(ntmp, ip, attrnum, attrname,
-   ntfs_btocn(off), vap);
-   if (error)
-   return (error);
-   towrite = MIN(left, ntfs_cntob(vap-va_vcnend + 1) - off);
-   ddprintf((ntfs_writeattr_plain: o: %d, s: %d (%d - %d)\n,
-(u_int32_t) off, (u_int32_t) towrite,
-(u_int32_t) vap-va_vcnstart,
-(u_int32_t) vap-va_vcnend));
-   error = ntfs_writentvattr_plain(ntmp, ip, vap,
-off - ntfs_cntob(vap-va_vcnstart),
-towrite, data, init, uio);
-   if (error) {
-   printf(ntfs_writeattr_plain:  \
-  ntfs_writentvattr_plain failed: o: %d, s: %d\n,
-  (u_int32_t) off, (u_int32_t) towrite);
-   printf(ntfs_writeattr_plain: attrib: %d - %d\n,
-  (u_int32_t) vap-va_vcnstart, 
-  (u_int32_t) vap-va_vcnend);
-   ntfs_ntvattrrele(vap);
-   break;
-   }
-   ntfs_ntvattrrele(vap);
-   left -= towrite;
-   off += towrite;
-   data = data + towrite;
-   *initp += init;
-   }
-
-   return (error);
-}
-
-/*
- * This is one of write routine.
- *
- * ntnode should be locked.
- */
-int
-ntfs_writentvattr_plain(
-   struct ntfsmount * ntmp,
-   struct ntnode * ip,
-   struct ntvattr * vap,
-   off_t roff,
-   size_t rsize,
-   void *rdata,
-   size_t * initp,
-   struct uio *uio)
-{
-   int error = 0;
-   off_t   off;
-   int cnt;
-   cn_tccn, ccl, cn, left, cl;
-   caddr_t data = rdata;
-   struct buf *bp;
-   size_t  tocopy;
-
-   *initp = 0;
-
-   if ((vap-va_flag  NTFS_AF_INRUN) == 0) {
-   printf(ntfs_writevattr_plain: CAN'T WRITE RES. ATTRIBUTE\n);
-   return ENOTTY;
-   }
-
-   ddprintf((ntfs_writentvattr_plain: data in run: %ld chains\n,
-vap-va_vruncnt));
-
-   off = roff;
-   left = rsize;
-   ccl = 0;
-   ccn = 0;
-   cnt = 0;
-   for (; left  (cnt  vap-va_vruncnt); cnt++) {
-   ccn = vap-va_vruncn[cnt];
-   ccl = vap-va_vruncl[cnt];
-
-   ddprintf((ntfs_writentvattr_plain:  \
-left %d, cn: 0x%x, cl: %d, off: %d\n, \
-(u_int32_t) left, (u_int32_t) ccn, \
-(u_int32_t) ccl, (u_int32_t) off));
-
-   if (ntfs_cntob(ccl)  off) {
-   off -= ntfs_cntob(ccl);
-   cnt++;
-   continue;
-   }
-   if (!ccn  ip-i_number != NTFS_BOOTINO)
-   continue; /* XXX */
-
-   ccl -= ntfs_btocn(off);
-   cn = ccn + ntfs_btocn(off);
-   off = ntfs_btocnoff(off);
-
-   while (left  ccl) {
-   /*
-* Always read and write single clusters at a time -
-* we need to avoid requesting differently-sized
-* blocks at the same disk offsets to avoid
-* confusing the buffer cache.
-*/
-   tocopy = MIN(left, ntfs_cntob(1) - off);
-   cl = ntfs_btocl(tocopy + 

svn commit: r238316 - head/sys/dev/ath

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 10 00:02:19 2012
New Revision: 238316
URL: http://svn.freebsd.org/changeset/base/238316

Log:
  Convert sc_rxpending to a per-EDMA queue, and use that for the legacy code.
  
  Prepare ath_rx_pkt() to handle multiple RX queues, and default the legacy
  RX queue to use the HP queue.

Modified:
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_rx.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cTue Jul 10 00:01:00 2012
(r238315)
+++ head/sys/dev/ath/if_ath_rx.cTue Jul 10 00:02:19 2012
(r238316)
@@ -463,9 +463,9 @@ ath_handle_micerror(struct ieee80211com 
}
 }
 
-static int
+int
 ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status,
-uint64_t tsf, int nf, struct ath_buf *bf)
+uint64_t tsf, int nf, HAL_RX_QUEUE qtype, struct ath_buf *bf)
 {
struct ath_hal *ah = sc-sc_ah;
struct mbuf *m = bf-bf_m;
@@ -475,6 +475,7 @@ ath_rx_pkt(struct ath_softc *sc, struct 
struct ieee80211com *ic = ifp-if_l2com;
struct ieee80211_node *ni;
int is_good = 0;
+   struct ath_rx_edma *re = sc-sc_rxedma[qtype];
 
/*
 * Calculate the correct 64 bit TSF given
@@ -559,9 +560,9 @@ rx_error:
/*
 * Cleanup any pending partial frame.
 */
-   if (sc-sc_rxpending != NULL) {
-   m_freem(sc-sc_rxpending);
-   sc-sc_rxpending = NULL;
+   if (re-m_rxpending != NULL) {
+   m_freem(re-m_rxpending);
+   re-m_rxpending = NULL;
}
/*
 * When a tap is present pass error frames
@@ -608,25 +609,25 @@ rx_accept:
 * it for the next completed descriptor, it
 * will be used to construct a jumbogram.
 */
-   if (sc-sc_rxpending != NULL) {
+   if (re-m_rxpending != NULL) {
/* NB: max frame size is currently 2 clusters */
sc-sc_stats.ast_rx_toobig++;
-   m_freem(sc-sc_rxpending);
+   m_freem(re-m_rxpending);
}
m-m_pkthdr.rcvif = ifp;
m-m_pkthdr.len = len;
-   sc-sc_rxpending = m;
+   re-m_rxpending = m;
goto rx_next;
-   } else if (sc-sc_rxpending != NULL) {
+   } else if (re-m_rxpending != NULL) {
/*
 * This is the second part of a jumbogram,
 * chain it to the first mbuf, adjust the
 * frame length, and clear the rxpending state.
 */
-   sc-sc_rxpending-m_next = m;
-   sc-sc_rxpending-m_pkthdr.len += len;
-   m = sc-sc_rxpending;
-   sc-sc_rxpending = NULL;
+   re-m_rxpending-m_next = m;
+   re-m_rxpending-m_pkthdr.len += len;
+   m = re-m_rxpending;
+   re-m_rxpending = NULL;
} else {
/*
 * Normal single-descriptor receive; setup
@@ -883,7 +884,7 @@ ath_rx_proc(struct ath_softc *sc, int re
/*
 * Process a single frame.
 */
-   if (ath_rx_pkt(sc, rs, status, tsf, nf, bf))
+   if (ath_rx_pkt(sc, rs, status, tsf, nf, HAL_RX_QUEUE_HP, bf))
ngood++;
 rx_proc_next:
TAILQ_INSERT_TAIL(sc-sc_rxbuf, bf, bf_list);
@@ -1016,9 +1017,16 @@ ath_legacy_stoprecv(struct ath_softc *sc
}
}
 #endif
-   if (sc-sc_rxpending != NULL) {
-   m_freem(sc-sc_rxpending);
-   sc-sc_rxpending = NULL;
+   /*
+* Free both high/low RX pending, just in case.
+*/
+   if (sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending != NULL) {
+   m_freem(sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending);
+   sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL;
+   }
+   if (sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending != NULL) {
+   m_freem(sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending);
+   sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL;
}
sc-sc_rxlink = NULL;   /* just in case */
 #undef PA2DESC
@@ -1034,7 +1042,8 @@ ath_legacy_startrecv(struct ath_softc *s
struct ath_buf *bf;
 
sc-sc_rxlink = NULL;
-   sc-sc_rxpending = NULL;
+   sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL;
+   sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL;
TAILQ_FOREACH(bf, sc-sc_rxbuf, bf_list) {
int error = ath_rxbuf_init(sc, bf);
if (error != 0) {

Modified: head/sys/dev/ath/if_ath_rx.h

svn commit: r238317 - head/sys/dev/ath

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 10 00:08:39 2012
New Revision: 238317
URL: http://svn.freebsd.org/changeset/base/238317

Log:
  Implement EDMA RX for AR93xx and later chips.
  
  This is inspired by ath9k and the reference driver, but it's a new
  implementation of the RX FIFO handling.
  
  This has some issues - notably the FIFO needs to be reprogrammed when
  the chip is reset.

Modified:
  head/sys/dev/ath/if_ath_rx_edma.c

Modified: head/sys/dev/ath/if_ath_rx_edma.c
==
--- head/sys/dev/ath/if_ath_rx_edma.c   Tue Jul 10 00:02:19 2012
(r238316)
+++ head/sys/dev/ath/if_ath_rx_edma.c   Tue Jul 10 00:08:39 2012
(r238317)
@@ -117,6 +117,38 @@ __FBSDID($FreeBSD$);
 
 #include dev/ath/if_ath_rx_edma.h
 
+/*
+ * some general macros
+  */
+#defineINCR(_l, _sz)   (_l) ++; (_l) = ((_sz) - 1)
+#defineDECR(_l, _sz)   (_l) --; (_l) = ((_sz) - 1)
+
+MALLOC_DECLARE(M_ATHDEV);
+
+/*
+ * XXX TODO:
+ *
+ * + Add an RX lock, just to ensure we don't have things clash;
+ * + Make sure the FIFO is correctly flushed and reinitialised
+ *   through a reset;
+ * + Handle the kickpcu state where the FIFO overflows.
+ * + Implement a flush routine, which doesn't push any
+ *   new frames into the FIFO.
+ * + Verify multi-descriptor frames work!
+ * + There's a memory use after free which needs to be tracked down
+ *   and fixed ASAP.  I've seen this in the legacy path too, so it
+ *   may be a generic RX path issue.
+ */
+
+/*
+ * XXX shuffle the function orders so these pre-declarations aren't
+ * required!
+ */
+static int ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUEUE qtype,
+   int nbufs);
+static int ath_edma_rxfifo_flush(struct ath_softc *sc, HAL_RX_QUEUE qtype);
+static void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf);
+
 static void
 ath_edma_stoprecv(struct ath_softc *sc, int dodelay)
 {
@@ -128,25 +160,51 @@ ath_edma_stoprecv(struct ath_softc *sc, 
 
DELAY(3000);
 
-   if (sc-sc_rxpending != NULL) {
-   m_freem(sc-sc_rxpending);
-   sc-sc_rxpending = NULL;
+   /* Flush RX pending for each queue */
+   /* XXX should generic-ify this */
+   if (sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending) {
+   m_freem(sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending);
+   sc-sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL;
}
 
-   sc-sc_rxlink = NULL;
+   if (sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending) {
+   m_freem(sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending);
+   sc-sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL;
+   }
 }
 
+/*
+ * Start receive.
+ *
+ * XXX TODO: this needs to reallocate the FIFO entries when a reset
+ * occurs, in case the FIFO is filled up and no new descriptors get
+ * thrown into the FIFO.
+ */
 static int
 ath_edma_startrecv(struct ath_softc *sc)
 {
struct ath_hal *ah = sc-sc_ah;
 
-   sc-sc_rxlink = NULL;
-   sc-sc_rxpending = NULL;
+   /* Enable RX FIFO */
+   ath_hal_rxena(ah);
+
+   /*
+* XXX write out a complete set of FIFO entries based on
+* what's currently available.
+*/
+
+   /* Add up to m_fifolen entries in each queue */
+   /*
+* These must occur after the above write so the FIFO buffers
+* are pushed/tracked in the same order as the hardware will
+* process them.
+*/
+   ath_edma_rxfifo_alloc(sc, HAL_RX_QUEUE_HP,
+   sc-sc_rxedma[HAL_RX_QUEUE_HP].m_fifolen);
+
+   ath_edma_rxfifo_alloc(sc, HAL_RX_QUEUE_LP,
+   sc-sc_rxedma[HAL_RX_QUEUE_LP].m_fifolen);
 
-   /* XXX setup HP RX queue FIFO pointer */
-   /* XXX setup LP RX queue FIFO pointer */
-   /* XXX ath_hal_rxena() */
ath_mode_init(sc);
ath_hal_startpcurecv(ah);
return (0);
@@ -157,6 +215,113 @@ ath_edma_recv_flush(struct ath_softc *sc
 {
 
device_printf(sc-sc_dev, %s: called\n, __func__);
+
+   /*
+* XXX for now, free all descriptors. Later on, complete
+* what can be completed!
+*/
+#if 0
+   ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_HP);
+   ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_LP);
+#endif
+}
+
+/*
+ * Process frames from the current queue.
+ *
+ * TODO:
+ *
+ * + Add a dosched flag, so we don't reschedule any FIFO frames
+ *   to the hardware or re-kick the PCU after 'kickpcu' is set.
+ *
+ * + Perhaps split check FIFO contents and handle frames, so
+ *   we can run the check FIFO contents in ath_intr(), but
+ *   handle frames in the RX tasklet.
+ */
+static int
+ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype)
+{
+   struct ath_rx_edma *re = sc-sc_rxedma[qtype];
+   struct ath_rx_status *rs;
+   struct ath_desc *ds;
+   struct ath_buf *bf;
+   int n = 0;
+   struct mbuf *m;
+   HAL_STATUS status;
+   struct ath_hal *ah = sc-sc_ah;
+   

svn commit: r238320 - head/sys/fs/ntfs

2012-07-09 Thread Attilio Rao
Author: attilio
Date: Tue Jul 10 00:23:25 2012
New Revision: 238320
URL: http://svn.freebsd.org/changeset/base/238320

Log:
  Remove a check on MNTK_UPDATE that is not really necessary as it is
  handled in a code snippet above.

Modified:
  head/sys/fs/ntfs/ntfs_vfsops.c

Modified: head/sys/fs/ntfs/ntfs_vfsops.c
==
--- head/sys/fs/ntfs/ntfs_vfsops.c  Tue Jul 10 00:14:42 2012
(r238319)
+++ head/sys/fs/ntfs/ntfs_vfsops.c  Tue Jul 10 00:23:25 2012
(r238320)
@@ -212,45 +212,22 @@ ntfs_mount(struct mount *mp)
return (err);
}
 
-   if (mp-mnt_flag  MNT_UPDATE) {
-#if 0
-   /*
-
-* UPDATE
-
-*/
-
-   if (devvp != ntmp-um_devvp)
-   err = EINVAL;   /* needs translation */
-   vput(devvp);
-   if (err)
-   return (err);
-#endif
-   } else {
-   /*
-
-* NEW MOUNT
-
-*/
-
-   /*
-* Since this is a new mount, we want the names for
-* the device and the mount point copied in.  If an
-* error occurs, the mountpoint is discarded by the
-* upper level code.  Note that vfs_mount() handles
-* copying the mountpoint f_mntonname for us, so we
-* don't have to do it here unless we want to set it
-* to something other than path for some rason.
-*/
 
-   err = ntfs_mountfs(devvp, mp, td);
-   if (err == 0) {
+   /*
+* Since this is a new mount, we want the names for the device and
+* the mount point copied in.  If an error occurs, the mountpoint is
+* discarded by the upper level code.  Note that vfs_mount() handles
+* copying the mountpoint f_mntonname for us, so we don't have to do
+* it here unless we want to set it to something other than path
+* for some rason.
+*/
 
-   /* Save mounted from info for mount point. */
-   vfs_mountedfrom(mp, from);
-   }
-   }
-   if (err)
+   err = ntfs_mountfs(devvp, mp, td);
+   if (err == 0) {
+
+   /* Save mounted from info for mount point. */
+   vfs_mountedfrom(mp, from);
+   } else
vrele(devvp);
return (err);
 }
___
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: r238325 - head/sys/arm/at91

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 01:13:00 2012
New Revision: 238325
URL: http://svn.freebsd.org/changeset/base/238325

Log:
  There's nothing AT91RM9200 specific about this file at all.

Modified:
  head/sys/arm/at91/uart_bus_at91usart.c

Modified: head/sys/arm/at91/uart_bus_at91usart.c
==
--- head/sys/arm/at91/uart_bus_at91usart.c  Tue Jul 10 00:58:40 2012
(r238324)
+++ head/sys/arm/at91/uart_bus_at91usart.c  Tue Jul 10 01:13:00 2012
(r238325)
@@ -42,33 +42,32 @@ __FBSDID($FreeBSD$);
 #include dev/uart/uart_bus.h
 #include dev/uart/uart_cpu.h
 
-#include arm/at91/at91rm92reg.h
 #include arm/at91/at91var.h
 
 #include uart_if.h
 
-static int usart_at91rm92_probe(device_t dev);
+static int usart_at91_probe(device_t dev);
 
 extern struct uart_class at91_usart_class;
 
-static device_method_t usart_at91rm92_methods[] = {
+static device_method_t usart_at91_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, usart_at91rm92_probe),
+   DEVMETHOD(device_probe, usart_at91_probe),
DEVMETHOD(device_attach,uart_bus_attach),
DEVMETHOD(device_detach,uart_bus_detach),
{ 0, 0 }
 };
 
-static driver_t usart_at91rm92_driver = {
+static driver_t usart_at91_driver = {
uart_driver_name,
-   usart_at91rm92_methods,
+   usart_at91_methods,
sizeof(struct uart_softc),
 };
 
 extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
 
 static int
-usart_at91rm92_probe(device_t dev)
+usart_at91_probe(device_t dev)
 {
struct uart_softc *sc;
 
@@ -104,4 +103,4 @@ usart_at91rm92_probe(device_t dev)
 }
 
 
-DRIVER_MODULE(uart, atmelarm, usart_at91rm92_driver, uart_devclass, 0, 0);
+DRIVER_MODULE(uart, atmelarm, usart_at91_driver, uart_devclass, 0, 0);
___
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: r238327 - head/sys/arm/xscale

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 01:32:52 2012
New Revision: 238327
URL: http://svn.freebsd.org/changeset/base/238327

Log:
  Not quite ready for this yet, so comment it out.

Modified:
  head/sys/arm/xscale/std.xscale

Modified: head/sys/arm/xscale/std.xscale
==
--- head/sys/arm/xscale/std.xscale  Tue Jul 10 01:25:25 2012
(r238326)
+++ head/sys/arm/xscale/std.xscale  Tue Jul 10 01:32:52 2012
(r238327)
@@ -1,3 +1,3 @@
 # $FreeBSD$
-machine arm armeb
+# machine arm armeb
 optionsARM_CACHE_LOCK_ENABLE
___
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: r238328 - head/lib/libc/i386/gen

2012-07-09 Thread David Xu
Author: davidxu
Date: Tue Jul 10 01:47:11 2012
New Revision: 238328
URL: http://svn.freebsd.org/changeset/base/238328

Log:
  Executing CPUID with EAX set to 1 to actually get feature flags.
  PR:   169730

Modified:
  head/lib/libc/i386/gen/getcontextx.c

Modified: head/lib/libc/i386/gen/getcontextx.c
==
--- head/lib/libc/i386/gen/getcontextx.cTue Jul 10 01:32:52 2012
(r238327)
+++ head/lib/libc/i386/gen/getcontextx.cTue Jul 10 01:47:11 2012
(r238328)
@@ -68,7 +68,7 @@ __getcontextx_size(void)
   movl%%ebx,%1\n
   popl%%ebx\n
: =a (p[0]), =r (p[1]), =c (p[2]), =d (p[3])
-   :  0 (0x0));
+   :  0 (0x1));
if ((p[2]  CPUID2_OSXSAVE) != 0) {
__asm __volatile(
   pushl   %%ebx\n
___
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: r238329 - in head/sys/arm: at91 conf econa include mv s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 01:49:50 2012
New Revision: 238329
URL: http://svn.freebsd.org/changeset/base/238329

Log:
  Remove some unused variables/externs that have been copied too many times...

Modified:
  head/sys/arm/at91/at91_machdep.c
  head/sys/arm/conf/KB920X
  head/sys/arm/econa/econa_machdep.c
  head/sys/arm/include/atomic.h
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/s3c2xx0/s3c24x0_machdep.c
  head/sys/arm/sa11x0/assabet_machdep.c
  head/sys/arm/xscale/i80321/ep80219_machdep.c
  head/sys/arm/xscale/i80321/iq31244_machdep.c
  head/sys/arm/xscale/i8134x/crb_machdep.c
  head/sys/arm/xscale/ixp425/avila_machdep.c
  head/sys/arm/xscale/pxa/pxa_machdep.c

Modified: head/sys/arm/at91/at91_machdep.c
==
--- head/sys/arm/at91/at91_machdep.cTue Jul 10 01:47:11 2012
(r238328)
+++ head/sys/arm/at91/at91_machdep.cTue Jul 10 01:49:50 2012
(r238329)
@@ -115,10 +115,6 @@ extern u_int undefined_handler_address;
 
 struct pv_addr kernel_pt_table[NUM_KERNEL_PTS];
 
-extern void *_end;
-
-extern int *end;
-
 struct pcpu __pcpu;
 struct pcpu *pcpup = __pcpu;
 
@@ -126,7 +122,6 @@ struct pcpu *pcpup = __pcpu;
 
 vm_paddr_t phys_avail[10];
 vm_paddr_t dump_avail[4];
-vm_offset_t physical_pages;
 
 struct pv_addr systempage;
 struct pv_addr msgbufpv;

Modified: head/sys/arm/conf/KB920X
==
--- head/sys/arm/conf/KB920XTue Jul 10 01:47:11 2012(r238328)
+++ head/sys/arm/conf/KB920XTue Jul 10 01:49:50 2012(r238329)
@@ -21,10 +21,16 @@
 ident  KB920X
 
 include../at91/std.kb920x
+# bring in the sam specific timers and such
+#include ../at91/std.at91sam9
+nodevice   at91rm9200
+device at91sam9
+device at91sam9x25
 # The AT91 platform doesn't use /boot/loader, so we have to statically wire
 # hints.
 hints  KB920X.hints
-#makeoptions   MODULES_OVERRIDE=
+makeoptionsMODULES_OVERRIDE=
+optionsLINUX_BOOT_ABI
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
 optionsDDB
@@ -81,7 +87,7 @@ devicelxtphy
 #options   WITNESS_SKIPSPIN#Don't run witness on spinlocks for 
speed
 
 device md
-device at91_twi# TWI: Two Wire Interface
+#deviceat91_twi# TWI: Two Wire Interface
 device at91_spi# SPI:
 device spibus
 # MMC/SD
@@ -137,6 +143,8 @@ device  wlan_wep# 802.11 WEP support
 device wlan_ccmp   # 802.11 CCMP support
 device wlan_tkip   # 802.11 TKIP support
 device wlan_amrr   # AMRR transmit rate control algorithm
+
+#devicecfi
 optionsIEEE80211_SUPPORT_MESH
 
 optionsAH_SUPPORT_AR5416

Modified: head/sys/arm/econa/econa_machdep.c
==
--- head/sys/arm/econa/econa_machdep.c  Tue Jul 10 01:47:11 2012
(r238328)
+++ head/sys/arm/econa/econa_machdep.c  Tue Jul 10 01:49:50 2012
(r238329)
@@ -103,10 +103,6 @@ extern u_int undefined_handler_address;
 
 struct pv_addr kernel_pt_table[NUM_KERNEL_PTS];
 
-extern void *_end;
-
-extern int *end;
-
 struct pcpu __pcpu;
 struct pcpu *pcpup = __pcpu;
 
@@ -114,7 +110,6 @@ struct pcpu *pcpup = __pcpu;
 
 vm_paddr_t phys_avail[10];
 vm_paddr_t dump_avail[4];
-vm_offset_t physical_pages;
 
 struct pv_addr systempage;
 struct pv_addr msgbufpv;

Modified: head/sys/arm/include/atomic.h
==
--- head/sys/arm/include/atomic.h   Tue Jul 10 01:47:11 2012
(r238328)
+++ head/sys/arm/include/atomic.h   Tue Jul 10 01:49:50 2012
(r238329)
@@ -347,7 +347,9 @@ atomic_readandclear_32(volatile u_int32_
 #defineatomic_cmpset_ptr(dst, old, new)\
 atomic_cmpset_32((volatile u_int *)(dst), (u_int)(old), (u_int)(new))
 #define atomic_cmpset_rel_ptr  atomic_cmpset_ptr
-#define atomic_cmpset_acq_ptr  atomic_cmpset_ptr
+#define atomic_cmpset_acq_ptr(dst, old, new) \
+atomic_cmpset_ptr((volatile uint32_t *)(dst), (volatile uint32_t)(old), \
+(volatile uint32_t)(new))
 #define atomic_store_ptr   atomic_store_32
 #define atomic_store_rel_ptr   atomic_store_ptr
 

Modified: head/sys/arm/mv/mv_machdep.c
==
--- head/sys/arm/mv/mv_machdep.cTue Jul 10 01:47:11 2012
(r238328)
+++ head/sys/arm/mv/mv_machdep.cTue Jul 10 01:49:50 2012
(r238329)
@@ -115,16 +115,11 @@ extern unsigned char _edata[];
 extern unsigned char __bss_start[];
 extern unsigned char _end[];
 
-#ifdef DDB
-extern vm_offset_t ksym_start, ksym_end;
-#endif
-
 extern u_int 

svn commit: r238330 - head/sys/arm/at91

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 02:14:50 2012
New Revision: 238330
URL: http://svn.freebsd.org/changeset/base/238330

Log:
  Eliminate the AT91_BASE for each SoC.  AT91_BASE is the right way
  to spell this since we only have one AT91_BASE for all Atmel arm9 SoCs.

Modified:
  head/sys/arm/at91/at91_reset.S
  head/sys/arm/at91/at91rm9200.c
  head/sys/arm/at91/at91rm92reg.h
  head/sys/arm/at91/at91sam9g20.c
  head/sys/arm/at91/at91sam9g20reg.h
  head/sys/arm/at91/at91sam9x25.c
  head/sys/arm/at91/at91sam9x25reg.h
  head/sys/arm/at91/uart_cpu_at91rm9200usart.c

Modified: head/sys/arm/at91/at91_reset.S
==
--- head/sys/arm/at91/at91_reset.S  Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91_reset.S  Tue Jul 10 02:14:50 2012
(r238330)
@@ -1,13 +1,14 @@
 #include machine/asm.h
 #include arm/at91/at91_rstreg.h
+#include arm/at91/at91reg.h
 #include arm/at91/at91sam9g20reg.h
 __FBSDID($FreeBSD$);
 
-#define SDRAM_TR  (AT91SAM9G20_BASE + \
+#define SDRAM_TR  (AT91_BASE + \
AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_TR)
-#define SDRAM_LPR (AT91SAM9G20_BASE + \
+#define SDRAM_LPR (AT91_BASE + \
AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_LPR)
-#define RSTC_RCR  (AT91SAM9G20_BASE + \
+#define RSTC_RCR  (AT91_BASE + \
AT91SAM9G20_RSTC_BASE + RST_CR)
 
 /*

Modified: head/sys/arm/at91/at91rm9200.c
==
--- head/sys/arm/at91/at91rm9200.c  Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91rm9200.c  Tue Jul 10 02:14:50 2012
(r238330)
@@ -164,8 +164,8 @@ at91_add_child(device_t dev, int prio, c
bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
if (irq2 != 0)
bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
-   if (addr != 0  addr  AT91RM92_BASE)
-   addr += AT91RM92_BASE;
+   if (addr != 0  addr  AT91_BASE)
+   addr += AT91_BASE;
if (addr != 0)
bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
 }

Modified: head/sys/arm/at91/at91rm92reg.h
==
--- head/sys/arm/at91/at91rm92reg.h Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91rm92reg.h Tue Jul 10 02:14:50 2012
(r238330)
@@ -70,7 +70,6 @@
  * 0xf000 - 0xf : Peripherals
  */
 
-#define AT91RM92_BASE  0xd000
 /* Usart */
 
 #define AT91RM92_USART_SIZE0x4000

Modified: head/sys/arm/at91/at91sam9g20.c
==
--- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:14:50 2012
(r238330)
@@ -157,8 +157,8 @@ at91_add_child(device_t dev, int prio, c
bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
if (irq2 != 0)
bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
-   if (addr != 0  addr  AT91SAM9G20_BASE)
-   addr += AT91SAM9G20_BASE;
+   if (addr != 0  addr  AT91_BASE)
+   addr += AT91_BASE;
if (addr != 0)
bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
 }

Modified: head/sys/arm/at91/at91sam9g20reg.h
==
--- head/sys/arm/at91/at91sam9g20reg.h  Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91sam9g20reg.h  Tue Jul 10 02:14:50 2012
(r238330)
@@ -73,8 +73,6 @@
 #define AT91_CHIPSELECT_7 0x8000
 
 
-#define AT91SAM9G20_BASE   0xd000
-
 #define AT91SAM9G20_EMAC_BASE 0xffc4000
 #define AT91SAM9G20_EMAC_SIZE 0x4000
 

Modified: head/sys/arm/at91/at91sam9x25.c
==
--- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:14:50 2012
(r238330)
@@ -160,8 +160,8 @@ at91_add_child(device_t dev, int prio, c
bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
if (irq2 != 0)
bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
-   if (addr != 0  addr  AT91SAM9X25_BASE) 
-   addr += AT91SAM9X25_BASE;
+   if (addr != 0  addr  AT91_BASE) 
+   addr += AT91_BASE;
if (addr != 0)
bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
 }

Modified: head/sys/arm/at91/at91sam9x25reg.h
==
--- head/sys/arm/at91/at91sam9x25reg.h  Tue Jul 10 01:49:50 2012
(r238329)
+++ head/sys/arm/at91/at91sam9x25reg.h  Tue Jul 10 02:14:50 2012
(r238330)
@@ -73,8 +73,6 @@
 #define AT91_CHIPSELECT_4 0x5000
 #define AT91_CHIPSELECT_5 0x6000
 

svn commit: r238331 - head/sys/arm/at91

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 02:39:03 2012
New Revision: 238331
URL: http://svn.freebsd.org/changeset/base/238331

Log:
  The system IRQ is always IRQ 1.  Make it so.

Modified:
  head/sys/arm/at91/at91reg.h
  head/sys/arm/at91/at91rm9200.c
  head/sys/arm/at91/at91sam9260.c
  head/sys/arm/at91/at91sam9g20.c
  head/sys/arm/at91/at91sam9x25.c

Modified: head/sys/arm/at91/at91reg.h
==
--- head/sys/arm/at91/at91reg.h Tue Jul 10 02:14:50 2012(r238330)
+++ head/sys/arm/at91/at91reg.h Tue Jul 10 02:39:03 2012(r238331)
@@ -85,4 +85,6 @@
 #defineAT91_EXID_SAM9G25   0x0003
 #defineAT91_EXID_SAM9X25   0x0004
 
+#define AT91_IRQ_SYSTEM1
+
 #endif /* _AT91REG_H_ */

Modified: head/sys/arm/at91/at91rm9200.c
==
--- head/sys/arm/at91/at91rm9200.c  Tue Jul 10 02:14:50 2012
(r238330)
+++ head/sys/arm/at91/at91rm9200.c  Tue Jul 10 02:39:03 2012
(r238331)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 
 #include arm/at91/at91var.h
+#include arm/at91/at91reg.h
 #include arm/at91/at91rm92reg.h
 #include arm/at91/at91_aicreg.h
 #include arm/at91/at91_pmcreg.h
@@ -157,7 +158,7 @@ at91_add_child(device_t dev, int prio, c
resource_list_init(ivar-resources);
if (irq0 != -1) {
bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
-   if (irq0 != AT91RM92_IRQ_SYSTEM)
+   if (irq0 != AT91_IRQ_SYSTEM)
at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
}
if (irq1 != 0)
@@ -238,7 +239,7 @@ at91_attach(device_t dev)
 
/* XXX Hack to tell atmelarm about the AIC */
at91sc-sc_aic_sh = sc-sc_aic_sh;
-   at91sc-sc_irq_system = AT91RM92_IRQ_SYSTEM;
+   at91sc-sc_irq_system = AT91_IRQ_SYSTEM;
 
for (i = 0; i  32; i++) {
bus_space_write_4(sc-sc_st, sc-sc_aic_sh, IC_SVR +

Modified: head/sys/arm/at91/at91sam9260.c
==
--- head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:14:50 2012
(r238330)
+++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:39:03 2012
(r238331)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 
 #include arm/at91/at91var.h
+#include arm/at91/at91reg.h
 #include arm/at91/at91_aicreg.h
 #include arm/at91/at91sam9260reg.h
 #include arm/at91/at91_pmcreg.h
@@ -150,7 +151,7 @@ at91_add_child(device_t dev, int prio, c
resource_list_init(ivar-resources);
if (irq0 != -1) {
bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
-   if (irq0 != AT91SAM9260_IRQ_SYSTEM)
+   if (irq0 != AT91_IRQ_SYSTEM)
at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
}
if (irq1 != 0)
@@ -238,7 +239,7 @@ at91_attach(device_t dev)
 
/* XXX Hack to tell atmelarm about the AIC */
at91sc-sc_aic_sh = sc-sc_aic_sh;
-   at91sc-sc_irq_system = AT91SAM9260_IRQ_SYSTEM;
+   at91sc-sc_irq_system = AT91_IRQ_SYSTEM;
 
for (i = 0; i  32; i++) {
bus_space_write_4(sc-sc_st, sc-sc_aic_sh, IC_SVR +

Modified: head/sys/arm/at91/at91sam9g20.c
==
--- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:14:50 2012
(r238330)
+++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:39:03 2012
(r238331)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 
 #include arm/at91/at91var.h
+#include arm/at91/at91reg.h
 #include arm/at91/at91_aicreg.h
 #include arm/at91/at91sam9g20reg.h
 #include arm/at91/at91_pmcreg.h
@@ -150,7 +151,7 @@ at91_add_child(device_t dev, int prio, c
resource_list_init(ivar-resources);
if (irq0 != -1) {
bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
-   if (irq0 != AT91SAM9G20_IRQ_SYSTEM)
+   if (irq0 != AT91_IRQ_SYSTEM)
at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
}
if (irq1 != 0)
@@ -249,7 +250,7 @@ at91_attach(device_t dev)
 
/* XXX Hack to tell atmelarm about the AIC */
at91sc-sc_aic_sh = sc-sc_aic_sh;
-   at91sc-sc_irq_system = AT91SAM9G20_IRQ_SYSTEM;
+   at91sc-sc_irq_system = AT91_IRQ_SYSTEM;
 
for (i = 0; i  32; i++) {
bus_space_write_4(sc-sc_st, sc-sc_aic_sh, IC_SVR +

Modified: head/sys/arm/at91/at91sam9x25.c
==
--- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:14:50 2012
(r238330)
+++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:39:03 2012
(r238331)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 
 #include arm/at91/at91var.h
+#include 

svn commit: r238332 - head/sys/arm/at91

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 02:44:15 2012
New Revision: 238332
URL: http://svn.freebsd.org/changeset/base/238332

Log:
  Missed one of the special AT91SAM9xxx_BASE defines.  This should be
  AT91_BASE.

Modified:
  head/sys/arm/at91/at91sam9260.c
  head/sys/arm/at91/at91sam9260reg.h

Modified: head/sys/arm/at91/at91sam9260.c
==
--- head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:39:03 2012
(r238331)
+++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:44:15 2012
(r238332)
@@ -158,8 +158,8 @@ at91_add_child(device_t dev, int prio, c
bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
if (irq2 != 0)
bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
-   if (addr != 0  addr  AT91SAM9260_BASE)
-   addr += AT91SAM9260_BASE;
+   if (addr != 0  addr  AT91_BASE)
+   addr += AT91_BASE;
if (addr != 0)
bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
 }

Modified: head/sys/arm/at91/at91sam9260reg.h
==
--- head/sys/arm/at91/at91sam9260reg.h  Tue Jul 10 02:39:03 2012
(r238331)
+++ head/sys/arm/at91/at91sam9260reg.h  Tue Jul 10 02:44:15 2012
(r238332)
@@ -72,8 +72,6 @@
 #define AT91_CHIPSELECT_7 0x8000
 
 
-#define AT91SAM9260_BASE   0xd000
-
 #define AT91SAM9260_EMAC_BASE 0xffc4000
 #define AT91SAM9260_EMAC_SIZE 0x4000
 
___
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: r238333 - head/sys/dev/ath/ath_hal

2012-07-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jul 10 03:48:07 2012
New Revision: 238333
URL: http://svn.freebsd.org/changeset/base/238333

Log:
  Reorder these so they match the capability enum order.

Modified:
  head/sys/dev/ath/ath_hal/ah.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==
--- head/sys/dev/ath/ath_hal/ah.c   Tue Jul 10 02:44:15 2012
(r238332)
+++ head/sys/dev/ath/ath_hal/ah.c   Tue Jul 10 03:48:07 2012
(r238333)
@@ -619,6 +619,19 @@ ath_hal_getcapability(struct ath_hal *ah
return pCap-hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_EXT_CHAN_DFS:
return pCap-halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_COMBINED_RADAR_RSSI:
+   return pCap-halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_AUTO_SLEEP:
+   return pCap-halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_MBSSID_AGGR_SUPPORT:
+   return pCap-halMbssidAggrSupport ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_SPLIT_4KB_TRANS:   /* hardware handles descriptors 
straddling 4k page boundary */
+   return pCap-hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP;
+   case HAL_CAP_REG_FLAG:
+   *result = AH_PRIVATE(ah)-ah_currentRDext;
+   return HAL_OK;
+   case HAL_CAP_ENHANCED_DMA_SUPPORT:
+   return pCap-halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_NUM_TXMAPS:
*result = pCap-halNumTxMaps;
return HAL_OK;
@@ -645,18 +658,6 @@ ath_hal_getcapability(struct ath_hal *ah
case HAL_CAP_RXBUFSIZE:
case HAL_CAP_NUM_MR_RETRIES:
return HAL_EINVAL;  /* XXX not yet */
-
-   case HAL_CAP_COMBINED_RADAR_RSSI:
-   return pCap-halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP;
-   case HAL_CAP_AUTO_SLEEP:
-   return pCap-halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP;
-   case HAL_CAP_MBSSID_AGGR_SUPPORT:
-   return pCap-halMbssidAggrSupport ? HAL_OK : HAL_ENOTSUPP;
-   case HAL_CAP_SPLIT_4KB_TRANS:   /* hardware handles descriptors 
straddling 4k page boundary */
-   return pCap-hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP;
-   case HAL_CAP_REG_FLAG:
-   *result = AH_PRIVATE(ah)-ah_currentRDext;
-   return HAL_OK;
case HAL_CAP_BT_COEX:
return pCap-halBtCoexSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_HT20_SGI:
@@ -694,8 +695,7 @@ ath_hal_getcapability(struct ath_hal *ah
return pCap-halHasBBReadWar? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */
return pCap-halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP;
-   case HAL_CAP_ENHANCED_DMA_SUPPORT:
-   return pCap-halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP;
+
default:
return HAL_EINVAL;
}
___
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: r238334 - head/sys/arm/at91

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 04:17:49 2012
New Revision: 238334
URL: http://svn.freebsd.org/changeset/base/238334

Log:
  Collapse all copies of at91_add_child into at91.c.  They were
  logically identical before today, and actually identical after today's
  changes.

Modified:
  head/sys/arm/at91/at91.c
  head/sys/arm/at91/at91rm9200.c
  head/sys/arm/at91/at91sam9260.c
  head/sys/arm/at91/at91sam9g20.c
  head/sys/arm/at91/at91sam9x25.c
  head/sys/arm/at91/at91var.h

Modified: head/sys/arm/at91/at91.c
==
--- head/sys/arm/at91/at91.cTue Jul 10 03:48:07 2012(r238333)
+++ head/sys/arm/at91/at91.cTue Jul 10 04:17:49 2012(r238334)
@@ -270,10 +270,12 @@ at91_attach(device_t dev)
}
 
 
-   /* Our device list will be added automatically by the cpu device
+   /*
+ * Our device list will be added automatically by the cpu device
 * e.g. at91rm9200.c when it is identified. To ensure that the
 * CPU and PMC are attached first any other identified devices
-* call BUS_ADD_CHILD(9) with an order of at least 2. */
+* call BUS_ADD_CHILD(9) with an order of at least 2.
+ */
 
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -471,6 +473,41 @@ at91_eoi(void *unused)
IC_EOICR, 0);
 }
 
+void
+at91_add_child(device_t dev, int prio, const char *name, int unit,
+bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2)
+{
+   device_t kid;
+   struct at91_ivar *ivar;
+
+   kid = device_add_child_ordered(dev, prio, name, unit);
+   if (kid == NULL) {
+   printf(Can't add child %s%d ordered\n, name, unit);
+   return;
+   }
+   ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO);
+   if (ivar == NULL) {
+   device_delete_child(dev, kid);
+   printf(Can't add alloc ivar\n);
+   return;
+   }
+   device_set_ivars(kid, ivar);
+   resource_list_init(ivar-resources);
+   if (irq0 != -1) {
+   bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
+   if (irq0 != AT91_IRQ_SYSTEM)
+   at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
+   }
+   if (irq1 != 0)
+   bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
+   if (irq2 != 0)
+   bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
+   if (addr != 0  addr  AT91_BASE) 
+   addr += AT91_BASE;
+   if (addr != 0)
+   bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
+}
+
 static device_method_t at91_methods[] = {
DEVMETHOD(device_probe, at91_probe),
DEVMETHOD(device_attach, at91_attach),

Modified: head/sys/arm/at91/at91rm9200.c
==
--- head/sys/arm/at91/at91rm9200.c  Tue Jul 10 03:48:07 2012
(r238333)
+++ head/sys/arm/at91/at91rm9200.c  Tue Jul 10 04:17:49 2012
(r238334)
@@ -137,41 +137,6 @@ static const struct cpu_devs at91_devs[]
 };
 
 static void
-at91_add_child(device_t dev, int prio, const char *name, int unit,
-bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2)
-{
-   device_t kid;
-   struct at91_ivar *ivar;
-
-   kid = device_add_child_ordered(dev, prio, name, unit);
-   if (kid == NULL) {
-   printf(Can't add child %s%d ordered\n, name, unit);
-   return;
-   }
-   ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO);
-   if (ivar == NULL) {
-   device_delete_child(dev, kid);
-   printf(Can't add alloc ivar\n);
-   return;
-   }
-   device_set_ivars(kid, ivar);
-   resource_list_init(ivar-resources);
-   if (irq0 != -1) {
-   bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
-   if (irq0 != AT91_IRQ_SYSTEM)
-   at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
-   }
-   if (irq1 != 0)
-   bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
-   if (irq2 != 0)
-   bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
-   if (addr != 0  addr  AT91_BASE)
-   addr += AT91_BASE;
-   if (addr != 0)
-   bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size);
-}
-
-static void
 at91_cpu_add_builtin_children(device_t dev)
 {
int i;

Modified: head/sys/arm/at91/at91sam9260.c
==
--- head/sys/arm/at91/at91sam9260.c Tue Jul 10 03:48:07 2012
(r238333)
+++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 04:17:49 2012
(r238334)
@@ -130,41 +130,6 @@ static const struct cpu_devs at91_devs[]
 };
 
 static void
-at91_add_child(device_t dev, int prio, const char *name, int unit,
-bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2)
-{
-   

svn commit: r238335 - head/sys/arm/conf

2012-07-09 Thread Warner Losh
Author: imp
Date: Tue Jul 10 05:39:06 2012
New Revision: 238335
URL: http://svn.freebsd.org/changeset/base/238335

Log:
  Revert last change.  It was accidental.

Modified:
  head/sys/arm/conf/KB920X

Modified: head/sys/arm/conf/KB920X
==
--- head/sys/arm/conf/KB920XTue Jul 10 04:17:49 2012(r238334)
+++ head/sys/arm/conf/KB920XTue Jul 10 05:39:06 2012(r238335)
@@ -21,16 +21,10 @@
 ident  KB920X
 
 include../at91/std.kb920x
-# bring in the sam specific timers and such
-#include ../at91/std.at91sam9
-nodevice   at91rm9200
-device at91sam9
-device at91sam9x25
 # The AT91 platform doesn't use /boot/loader, so we have to statically wire
 # hints.
 hints  KB920X.hints
 makeoptionsMODULES_OVERRIDE=
-optionsLINUX_BOOT_ABI
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
 optionsDDB
@@ -87,7 +81,7 @@ devicelxtphy
 #options   WITNESS_SKIPSPIN#Don't run witness on spinlocks for 
speed
 
 device md
-#deviceat91_twi# TWI: Two Wire Interface
+device at91_twi# TWI: Two Wire Interface
 device at91_spi# SPI:
 device spibus
 # MMC/SD
@@ -144,7 +138,6 @@ device  wlan_ccmp   # 802.11 CCMP support
 device wlan_tkip   # 802.11 TKIP support
 device wlan_amrr   # AMRR transmit rate control algorithm
 
-#devicecfi
 optionsIEEE80211_SUPPORT_MESH
 
 optionsAH_SUPPORT_AR5416
___
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: r238336 - head/sys/kern

2012-07-09 Thread David Xu
Author: davidxu
Date: Tue Jul 10 05:45:13 2012
New Revision: 238336
URL: http://svn.freebsd.org/changeset/base/238336

Log:
  Always clear p_xthread if current thread no longer needs it, in theory, if
  debugger exited without calling ptrace(PT_DETACH), there is a time window
  that the p_xthread may be pointing to non-existing thread, in practical,
  this is not a problem because child process soon will be killed by parent
  process.

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cTue Jul 10 05:39:06 2012(r238335)
+++ head/sys/kern/kern_sig.cTue Jul 10 05:45:13 2012(r238336)
@@ -2436,9 +2436,10 @@ ptracestop(struct thread *td, int sig)
}
 stopme:
thread_suspend_switch(td);
-   if (!(p-p_flag  P_TRACED)) {
+   if (p-p_xthread == td)
+   p-p_xthread = NULL;
+   if (!(p-p_flag  P_TRACED))
break;
-   }
if (td-td_dbgflags  TDB_SUSPEND) {
if (p-p_flag  P_SINGLE_EXIT)
break;
___
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