]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agomips/mips64eb became mips/mips64 while I wasn't looking (whoops), so update
rwatson [Wed, 2 May 2012 12:15:34 +0000 (12:15 +0000)]
mips/mips64eb became mips/mips64 while I wasn't looking (whoops), so update
GXEMUL kernel config for the new world order.

Spotted by: bz
MFC after: 3 weeks

12 years agoBump __FreeBSD_version due to jemalloc import.
jasone [Wed, 2 May 2012 10:15:42 +0000 (10:15 +0000)]
Bump __FreeBSD_version due to jemalloc import.

12 years agoThe PIT is really 16 bytes long (0x10) not 10 bytes long. Doesn't
imp [Wed, 2 May 2012 09:19:42 +0000 (09:19 +0000)]
The PIT is really 16 bytes long (0x10) not 10 bytes long.  Doesn't
matter much, since these defines are unused...

Obtained from: AT91SAM9G20 datasheet

12 years agoClean up various aspects of the MIPS generic busspace implementation:
rwatson [Wed, 2 May 2012 08:23:53 +0000 (08:23 +0000)]
Clean up various aspects of the MIPS generic busspace implementation:

1) Always implement missing bus space methods using a panic() stub rather
   than a NULL pointer.  This appeared not to trip up any existing device
   drivers, but due to the nature of the devices I'm supporting locally,
   I'm making use of some of the more obscure busspace methods, and
   panic() is a preferred failure mode.  For example, do this for the
   setregion methods.

2) Hook up several existing busspace method implementations that were
   provided in the file, but not actually present in the methods
   structure.  Especially, single-byte bus I/O routines.  This should
   allow bugs to be fixed in the Atheros 802.11 driver.

There are still some remaining unimplemented methods that would be
desirable to implement -- especially, 64-bit I/O calls that would
observably accelerate device performance on FPGA-based soft CPU cores
that are typically clocked an order of magnitude slower than
conventional hard core CPUs, but that remains for another day.

MFC after: 3 weeks
Discussed with: jmallett, scottl
Sponsored by: DARPA, AFRL

12 years agoMerge a rudimentary gxemul "oldtestmips" port. This consists almost
rwatson [Wed, 2 May 2012 08:10:15 +0000 (08:10 +0000)]
Merge a rudimentary gxemul "oldtestmips" port.  This consists almost
entirely of one machdep file lifted from the MALTA port, as well as
a low-level console and tty driver for the gxemul debugging console
device (the emulators stdio).  As with many low-level embedded and
hypervisor console devices, it is polled only, so we drive TTY I/O
from a callout; we are perhaps a bit too aware of the MIPS physical
maps in order to attach the console before newbus comes to life.

The sample kernel configuration depends on an MD-based root file
system, which is not provided.  However, any 64-bit, big-endian
userspace image (such as one generated for MALTA) should work.

This will hopefully be supplemented by additional device drivers for
gxemul-specific hardware simulations from Juli Mallett.  We have
found oldtestmips quite useful for testing and improving aspects of
the MIPS port, so it's worth supporting better in FreeBSD.

Requested by: theraven, jmallett
Sponsored by: DARPA, AFRL
MFC after: 3 weeks

12 years agoImplement PLL configuration override support, similar to what openwrt
adrian [Wed, 2 May 2012 07:43:11 +0000 (07:43 +0000)]
Implement PLL configuration override support, similar to what openwrt
implements.

12 years agoDisable the pll_1000 hint for now, the upcoming work enables it and it
adrian [Wed, 2 May 2012 07:41:26 +0000 (07:41 +0000)]
Disable the pll_1000 hint for now, the upcoming work enables it and it
breaks without the switch PHY code.

12 years ago* Force the ethernet MII configuration to be RGMII
adrian [Wed, 2 May 2012 06:19:26 +0000 (06:19 +0000)]
* Force the ethernet MII configuration to be RGMII
* Populate the "pll_1000" field, which will soon be used to override the
  PLL configuration from the default value.

Obtained from: Linux OpenWRT

12 years agoAllow the MII mode to be overridden via 'hint.arge.X.miimode'.
adrian [Wed, 2 May 2012 06:18:12 +0000 (06:18 +0000)]
Allow the MII mode to be overridden via 'hint.arge.X.miimode'.

It takes a number at the moment, rather than a string.

Some of the Linux board configurations specify the MII mode explicitly.

12 years agoAdd a missing newline.
adrian [Wed, 2 May 2012 06:17:16 +0000 (06:17 +0000)]
Add a missing newline.

12 years agoRemove some redundant register loads.
kientzle [Wed, 2 May 2012 05:49:58 +0000 (05:49 +0000)]
Remove some redundant register loads.

Discussed on: arm@

12 years agoFurther ar71xx MII support improvements.
adrian [Wed, 2 May 2012 04:51:43 +0000 (04:51 +0000)]
Further ar71xx MII support improvements.

* Flesh out the PLL configuration fetch function, which will return the PLL
  configuration based on the unit number and speed.
* Remove the PLL speed config logic from the AR71xx/AR91xx chip PLL config
  function - pass in a 'pll' value instead.
* Modify arge_set_pll() to:
  + fetch the PLL configuration
  + write the PLL configuration
  + update the MII speed configuration.

This will allow if_arge to override the PLL configuration as required.

Obtained from: Linux/Atheros/OpenWRT

12 years agoMII related infrastructure changes.
adrian [Wed, 2 May 2012 01:21:57 +0000 (01:21 +0000)]
MII related infrastructure changes.

* Add a new method to set the MII mode - GMII, RGMII, RMII, MII.
  + arge0 supports all four (two for non-Gige interfaces.)
  + arge1 only supports two (one for non-gige interfaces.)
* Set the MII clock speed when changing the MAC PLL speed.
  + Needed for AR91xx and AR71xx; not needed for AR724x.

Tested:

* AR71xx only, I'll do AR913x testing tonight and fix whichever issues
  creep up.

TODO:

* Implement the missing AR7242 arge0 PLL configuration, but don't
  adjust the MII speed accordingly.
* .. the AR7240/AR7241 don't require this, so make sure it's not set
  accidentally.

Bugs (not fixed here):

* Statically configured arge speeds are still broken - investigate why
  that is on the AP96 board.  Autonegotiate is working fine, but there
  still seems to be an occasionally heavy packet loss issue.

Obtained from: Linux/Atheros/OpenWRT

12 years agoIntroduce an enum which encapsulates the PHY interface types that can be
adrian [Wed, 2 May 2012 01:14:15 +0000 (01:14 +0000)]
Introduce an enum which encapsulates the PHY interface types that can be
configured.

12 years ago- Add missing locking in at91_usart_getc().
marius [Tue, 1 May 2012 20:42:03 +0000 (20:42 +0000)]
- Add missing locking in at91_usart_getc().
- Align the RX buffers on the cache line size, otherwise the requirement
  of partial cache line flushes on every are pretty much guaranteed. [1]
- Make the code setting the RX timeout match its comment (apparently,
  start and stop bits were missed in the previous calculation). [1]
- Cover the busdma operations in at91_usart_bus_{ipend,transmit}() with
  the hardware mutex, too, so these don't race against each other.
- In at91_usart_bus_ipend(), reduce duplication in the code dealing with
  TX interrupts.
- In at91_usart_bus_ipend(), turn the code dealing with RX interrupts
  into an else-if cascade in order reduce its complexity and to improve
  its run-time behavior.
- In at91_usart_bus_ipend(), add missing BUS_DMASYNC_PREREAD calls on
  the RX buffer map before handing things over to the hardware again. [1]
- In at91_usart_bus_getsig(), used a variable of sufficient width for
  storing the contents of USART_CSR.
- Use KOBJMETHOD_END.
- Remove an unused header.

Submitted by: Ian Lepore [1]
Reviewed by: Ian Lepore
MFC after: 1 week

12 years agoAdd in the MII configuration parameters for the AR71xx.
adrian [Tue, 1 May 2012 20:32:38 +0000 (20:32 +0000)]
Add in the MII configuration parameters for the AR71xx.

Obtained from: Linux/OpenWRT

12 years agoImprove spare disks support. Unluckily, for some reason Adaptec 1430SA
mav [Tue, 1 May 2012 18:00:31 +0000 (18:00 +0000)]
Improve spare disks support. Unluckily, for some reason Adaptec 1430SA
RAID BIOS doesn't want to understand spare disks created by graid. But
at least spares created by BIOS are working fine now.

12 years agoAdd initial support for booting from ZFS on sparc64. At least on Sun Fire
marius [Tue, 1 May 2012 17:16:01 +0000 (17:16 +0000)]
Add initial support for booting from ZFS on sparc64. At least on Sun Fire
V100, the firmware is known to be broken and not allowing to simultaneously
open disk devices, causing attempts to boot from a mirror or RAIDZ to cause
a crash. This will be worked around later. The firmwares of newer sun4u models
don't seem to exhibit this problem though.

Steps for ZFS booting:

1. create VTOC8 label
# gpart create -s vtoc8 da0

2. add partitions, f.e.:
# gpart add -t freebsd-zfs -s 60g da0
# gpart add -t freebsd-swap da0
resulting in something like:
# gpart show
=>        0  143331930  da0  VTOC8  (68G)
          0  125821080    1  freebsd-zfs  (60G)
  125821080   17510850    2  freebsd-swap  (8.4G)

3. create zpool
# zpool create bunker da0a
or for mirror/RAIDZ (after preparing additional disks as in steps 1. + 2.):
# zpool create bunker mirror da0a da1a
# zpool create bunker raidz da0a da1a da2a ...

4. set bootfs
# zpool set bootfs=bunker bunker

5. install zfsboot
# zpool export bunker
# gpart bootcode -p /boot/zfsboot da0

6. write zfsloader to the ZFS Boot Block (so far, there's no dedicated tool
for this, so dd(1) has to be used for this purpose)
When using mirror/RAIDZ, step 4. and the dd(1) invocation should be repeated
for the additional disks in order to be able to boot from another disk in
case of failure.
# sysctl kern.geom.debugflags=0x10
# dd if=/boot/zfsloader of=/dev/da0a bs=512 oseek=1024 conv=notrunc
# zpool import bunker

7. install system on ZFS filesystem
Don't forget to set 'zfs_load="YES"' and vfs.root.mountfrom="zfs:bunker" in
loader.conf as well as 'zfs_enable="YES"'in rc.conf.

8. copy zpool.cache to the ZFS filesystem
cp -p /boot/zfs/zpool.cache /bunker/boot/zfs/zpool.cache

9. set mountpoint
# zfs set mountpoint=/ bunker

10. Now, given that aliases for all disks in the zpool exists (check with
the `devalias` command on the boot monitor prompt) and disk0 corresponds
to da0 (likewise for additional disks), the system can be booted from the
ZFS with:
{1} ok boot disk0

PR:             165025
Submitted by:   Gavin Mu

12 years agoAdd a command for showing the heap usage.
marius [Tue, 1 May 2012 16:38:33 +0000 (16:38 +0000)]
Add a command for showing the heap usage.

PR: 165025
Submitted by: Gavin Mu
MFC after: 1 week

12 years agoUpdate HWMP Proactive code and mesh route flags.
monthadar [Tue, 1 May 2012 16:18:38 +0000 (16:18 +0000)]
Update HWMP Proactive code and mesh route flags.

* Modified hwmp_recv_preq:
    o cleaned up code, removed rootmac variable because preq->origaddr
      is the root when we recevie a Proactive PREQ;
    o Modified so that a PREP in response of a Proactive PREQ is unicast,
      a PREP is ALWAYS unicast;
* Modified hwmp_recv_prep:
    o Before we mark a route to be valid we should remove the discovery
      flag and then mark it valid in such a way we wont lose the isgate flag;

Approved by: adrian

12 years ago* Modified ifconfig to show the IEEE80211_MESHRT_FLAGS_DISCOVER flag with a 'D';
monthadar [Tue, 1 May 2012 16:17:17 +0000 (16:17 +0000)]
* Modified ifconfig to show the IEEE80211_MESHRT_FLAGS_DISCOVER flag with a 'D';

Approved by: adrian

12 years agoPREQ discovery update.
monthadar [Tue, 1 May 2012 16:16:20 +0000 (16:16 +0000)]
PREQ discovery update.

* Added a new discovery flag IEEE80211_MESHRT_FLAGS_DISCOVER;
* Modified ieee80211_ioctl.h to include IEEE80211_MESHRT_FLAGS_DISCOVER;
* Added hwmp_rediscover_cb, which will be called by a timeout to do
rediscovery if we have not reach max number of preq discovery;
* Modified hwmp_discover to setup a callout for path rediscovery;
* Added to ieee80211req_mesh_route to have a back pointer to ieee80211vap
for the discovery callout context;
* Modified mesh_rt_add_locked arguemnt from ieee80211_mesh_state to
ieee80211vap, this because we have to initialize the above back pointer;

Approved by: adrian

12 years ago* Added new command to ifconfig to activate Mesh Gate Announcement called
monthadar [Tue, 1 May 2012 16:15:34 +0000 (16:15 +0000)]
* Added new command to ifconfig to activate Mesh Gate Announcement called
meshgate with corresponding explanation;

Approved by: adrian

12 years agoNet80211s update: Mesh Gate Announcement and removal of Portal Announcement.
monthadar [Tue, 1 May 2012 16:14:18 +0000 (16:14 +0000)]
Net80211s update: Mesh Gate Announcement and removal of Portal Announcement.

 * Renamed IEEE80211_ELEMID_MESHPANN to IEEE80211_ELEMID_MESHGANN according to
 amendment;
 * Added IEEE80211_IOC_MESH_GATE that controls whether Mesh Gate Announcement
 is activated or not;
 * Renamed all flags from Portal to Gate in HWMP frames;
 * Removed IEEE80211_ACTION_MESHPANN enum cause its part of the Mesh Action
 category now as per amendment;
 * Renamed IEEE80211_MESHFLAGS_PORTAL to IEEE80211_MESHFLAGS_GATE in
 ieee80211_mesh_state flags;
 * Modified ieee80211_hwmp.c/ieee80211_mesh.c to use new GATE flags;

Approved by: adrian

12 years agoRANN update
monthadar [Tue, 1 May 2012 16:13:22 +0000 (16:13 +0000)]
RANN update

* Introduced a new HWMP sysctl, Root Confirmation Interval;
* Added hr_lastrootconf to hwmp_route, is for ratecheck for a specific ROOT;
* We missed reading RANN.interval subfield from a RANN frame before;
* Updated hwmp_recv_rann according to amendment, see comments;

Approved by: adrian

12 years agoPERR update to be called from mesh code.
monthadar [Tue, 1 May 2012 16:12:39 +0000 (16:12 +0000)]
PERR update to be called from mesh code.

* Added mpp_senderror for Mesh Path Selection protocol;
* Added hwmp_senderror that will send an HWMP PERR according to the
supplied reason code;
* Call mpp_senderror when deleting a route with correct reason code
for whether the route is marked proxy or not;
* Call mpp_senderror when trying to forward an individually addressed
frame and there is no forwarding information;

Approved by: adrian

12 years ago* Modified PERR acceptance criteria according to amendment;
monthadar [Tue, 1 May 2012 16:11:47 +0000 (16:11 +0000)]
* Modified PERR acceptance criteria according to amendment;
* Modified how PERR is handled and propagated according to amendment;

Approved by: adrian

12 years agoUpdated PREQ propagation code;
monthadar [Tue, 1 May 2012 16:10:32 +0000 (16:10 +0000)]
Updated PREQ propagation code;

* When receiving a Proactive PREQ dont return after processing it but propagate;
* When we propagate we should not enforce ratechecking;
* Added checking for multiple pred ID detection;
* Storing proxy orig address when PREQ is not for us;

Approved by: adrian

12 years ago* PREQ acceptance criteria updated to check for proxy condition as in amendment;
monthadar [Tue, 1 May 2012 16:09:44 +0000 (16:09 +0000)]
* PREQ acceptance criteria updated to check for proxy condition as in amendment;

Approved by: adrian

12 years ago* Proactive PREQ (original transmission) must also set
monthadar [Tue, 1 May 2012 16:08:46 +0000 (16:08 +0000)]
* Proactive PREQ (original transmission) must also set
IEEE80211_MESHPREQ_TFLAGS_USN flag in target_flag field;

Approved by: adrian

12 years ago* Fixed hwmp_discover code to populate a PREQ packet correctly;
monthadar [Tue, 1 May 2012 16:07:35 +0000 (16:07 +0000)]
* Fixed hwmp_discover code to populate a PREQ packet correctly;
* Removed IEEE80211_MESHPREQ_TFLAGS_RF which is no longer part of the
amendment spec;

Approved by: adrian

12 years ago* Fixed PREQ flag field Adressing mode subfiled according to amendment specs;
monthadar [Tue, 1 May 2012 16:06:20 +0000 (16:06 +0000)]
* Fixed PREQ flag field Adressing mode subfiled according to amendment specs;

Approved by: adria

12 years ago* Added a mesh max PREQ retires sysctl that governous how many times
monthadar [Tue, 1 May 2012 16:05:09 +0000 (16:05 +0000)]
* Added a mesh max PREQ retires sysctl that governous how many times
we try to discover an address;
* Added a mesh net travelse time across an MBSS, which is used to enforce
discovery rate check;

Approved by: adrian

12 years agoChange how we enforce PREQ minimum interval.
monthadar [Tue, 1 May 2012 16:03:27 +0000 (16:03 +0000)]
Change how we enforce PREQ minimum interval.

* Moved hs_lastpreq to be hr_lastpreq cause this rate check should be per
target mesh STA according to amendment (NB: not applicable for PERR);
* Modified hwmp_send_preq to use two extra arguments for last sent PREQ and
minimum PREQ interval;
* hwmp_send_preq is called with last two arguments equal to NULL when sending
Proactive PREQs cause the call back task enforces the rate check;

Approved by: adrian

12 years agoPREP update
monthadar [Tue, 1 May 2012 16:02:31 +0000 (16:02 +0000)]
PREP update

* Added assertion in mesh_rt_update;
* Fixed some prep propagation that where multicast, ALL PREPS ARE UNICAST;
* Fixed PREP acceptance criteria;
* Fixed some PREP debug messages;
* HWMP intermediate reply (PREP) should only be sent if we have newer
forwarding infomration (FI) about target;
* Fixed PREP propagation condition and PREP w/ AE handling;
* Ignore PREPs that have unknown originator.
* Removed old code inside PREP that was for proactive path building
to root mesh;

Other errors include:
* use seq number of target and not orig mesh STA;
* Metric is what we have stored in our FI;
* Error in amendment, Hop count is not 0 but equals FI hopcount for target;

Approved by: adrian

12 years ago* MeshForwarding update mesh_recv_indiv_data_to_fwrd to silently discard
monthadar [Tue, 1 May 2012 16:00:31 +0000 (16:00 +0000)]
* MeshForwarding update mesh_recv_indiv_data_to_fwrd to silently discard
unknown meshDA instead of panic, which is allowed per amendment spec;

Approved by: adrian

12 years agoAdded route lifetime update for destination and source mesh along a mesh path;
monthadar [Tue, 1 May 2012 15:58:10 +0000 (15:58 +0000)]
Added route lifetime update for destination and source mesh along a mesh path;

 * In mesh_recv_indiv_data_to_fwd update route entry for both meshDA and meshSA;
 * In mesh_recv_indiv_data_to_me update route entry for meshSA;
 * in ieee80211_mesh_rt_update put code so that a proxy entry that is gated
 by us (number of hops == 0) is never invalidated;
 * Fixed so that we always call ieee80211_mesh_rt_update with lifetime in ms;

Approved by: adrian

12 years agoMesh forwarding with proxy support.
monthadar [Tue, 1 May 2012 15:56:26 +0000 (15:56 +0000)]
Mesh forwarding with proxy support.

* Modified HWMP PREP/PREQ to contain a proxy entry and also changed PREP
frame processing according to amendment as following:
        o Fixed PREP to always update/create if acceptance criteria is meet;
        o PREQ processing to reply if request is for a proxy entry that is
          proxied by us;
        o Removed hwmp_discover call from PREQ, because sending a PREP will
          build the forward path, and by receving and accepting a PREQ we
          have already built the reverse path (non-proactive code);
* Disabled code for pro-active in PREP for now (will make a separate patch for
pro-active HWMP routing later)
* Added proxy information for a Mesh route, mesh gate to use and proxy seqno;
* Modified ieee80211_encap according to amendment;
* Introduced Mesh control address extension enum and removed unused struct,
also rename some structure element names.
* Modified mesh_input and added mesh_recv_* that should verify and process mesh
data frames according to 9.32 Mesh forwarding framework in amendment;
* Modified mesh_decap accordingly to changes done in mesh control AE struct;

Approved by: adrian

12 years agoImplemented so that Mesh forwarding information lifetime is dynamic.
monthadar [Tue, 1 May 2012 15:47:30 +0000 (15:47 +0000)]
Implemented so that Mesh forwarding information lifetime is dynamic.

 * Introduced ieee80211_mesh_rt_update that updates a route with the
 maximum(lifetime left, new lifetime);
 * Modified ieee80211_mesh_route struct by adding a lock that will be used
 by both ieee80211_mesh_rt_update and precursor code (added in future commit);
 * Modified in ieee80211_hwmp.c HWMP code to use new ieee80211_mesh_rt_update;
 * Modified mesh_rt_flush_invalid to use new ieee80211_mesh_rt_update;
 * mesh_rt_flush also checks that lifetime == 0, this gives route discovery
 a change to complete;
 * Modified mesh_recv_mgmt case IEEE80211_FC0_SUBTYPE_BEACON:
 when ever we received a beacon from a neighbor we update route lifetime;

Approved by: adrian

12 years agoFixed some MPM reason codes and max number of neighbors check
monthadar [Tue, 1 May 2012 15:42:41 +0000 (15:42 +0000)]
Fixed some MPM reason codes and max number of neighbors check

 * Added IEEE80211_MESH_MAX_NEIGHBORS and it is set to 15, same as before;
 * Modified mesh_parse_meshpeering_action to verify MPM frame and send
 correct reason code for when a frame is rejected according to standard spec;
 * Modified mesh_recv_action_meshpeering_* according to the standard spec;
 * Modified mesh_peer_timeout_cb to always send CLOSE frame when in CONFIRMRCV
 state according to the standard spec;

Approved by: adrian

12 years agoModified structure and code that handles Mesh peering management.
monthadar [Tue, 1 May 2012 15:39:16 +0000 (15:39 +0000)]
Modified structure and code that handles Mesh peering management.

 * Old struct ieee80211_meshpeer_ie had wrong peer_proto field size;
 * Added IEEE80211_MPM_* size macros;
 * Created an enum for the Mesh Peering Protocol Identifier field according
 to the standard spec and removed old defines;
 * Abbreviated Handshake Protocol is not used by the standard anymore;
 * Modified mesh_verify_meshpeer to use IEEE80211_MPM_* macros for verification;
 * Modified mesh_parse_meshpeering_action to parse complete frame, also to parse
 it according to the standard spec;
 * Modified ieee80211_add_meshpeer to construct correct MPM frames according to
 the standard spec;

Approved by: adrian

12 years agoAdded Self-protected action category (including MPM).
monthadar [Tue, 1 May 2012 15:35:10 +0000 (15:35 +0000)]
Added Self-protected action category (including MPM).

* Added new action category IEEE80211_ACTION_CAT_SELF_PROT which is used by 11s
for Mesh Peering Management;
* Updated Self protected enum Action codes to start from 1 instead of 0
according to the standard spec;
* Removed old and wrong action categories IEEE80211_ACTION_CAT_MESHPEERING;
* Modified ieee80211_mesh.c and ieee80211_action.c to use the new action
category code;
* Added earlier verification code in ieee80211_input;

Approved by: adrian

12 years agoChange the MIB cycle count API to return HAL_BOOL, rather than uint32_t,
adrian [Tue, 1 May 2012 14:48:51 +0000 (14:48 +0000)]
Change the MIB cycle count API to return HAL_BOOL, rather than uint32_t,
to return whether it was successful.

Add placeholder (blank) methods for previous chips, for both it and
the 11n extension channel busy call.

12 years ago- close the open file after fetching
bapt [Tue, 1 May 2012 10:16:12 +0000 (10:16 +0000)]
- close the open file after fetching
- create a default /usr/local/etc/pkg.conf

Approved by: des (mentor)

12 years agoImplement volume deletion if disk has more then one partition.
mav [Tue, 1 May 2012 09:21:21 +0000 (09:21 +0000)]
Implement volume deletion if disk has more then one partition.

12 years agoImprove DDF metadata writing.
mav [Tue, 1 May 2012 08:19:29 +0000 (08:19 +0000)]
Improve DDF metadata writing.

12 years ago- fixed a vnode lock hang-up issue.
daichi [Tue, 1 May 2012 07:46:30 +0000 (07:46 +0000)]
- fixed a vnode lock hang-up issue.
- fixed an incorrect lock status issue.
- fixed an incorrect lock issue of unionfs root vnode removed.
  (pointed out by keith)
- fixed an infinity loop issue.
  (pointed out by dumbbell)
- changed to do LK_RELEASE expressly when unlocked.

Submitted by: ozawa@ongs.co.jp

12 years agoFix make depend.
uqs [Tue, 1 May 2012 07:38:40 +0000 (07:38 +0000)]
Fix make depend.

12 years agoConvert AP96 to use the mdioproxy and ARGE_MDIO option.
adrian [Tue, 1 May 2012 06:21:02 +0000 (06:21 +0000)]
Convert AP96 to use the mdioproxy and ARGE_MDIO option.

arge1 still works (it's the standalone PHY) but arge0 and the other switch
ports don't work.  They're enumerated though, demonstrating that the
mdiobus abstraction is correctly working.

12 years agoBreak out the arge MDIO bus code into an optional argemdio device.
adrian [Tue, 1 May 2012 06:18:30 +0000 (06:18 +0000)]
Break out the arge MDIO bus code into an optional argemdio device.

This is only done if the ARGE_MDIO option is included.

* Shuffle the arge MDIO bus into a separate device, that needs to be
  probed early (use hint.argemdio.X.order=0)
* hint.arge.X.mdio now specifies which miiproxy to rendezvous with.
* Call MAC/MDIO bus init during MDIO attach, not arge attach.

This is done regardless:

* Shift the arge MAC and MDIO bus reset code into separate functions
  and call it early during MDIO bus attach.  It's required for
  correct MDIO bus IO to occur on AR71xx/AR91xx devices.

* Remove the AR71xx/AR91xx centric assumption that there's only one
  MDIO bus.  The initial code mapped miibus0(arge0) and miibus1(arge1)
  MII register operations to the MII0 (arge0) register space.  The
  AR724x (and later, upcoming chipsets) have two MDIO busses and
  the second is very much in use.

TODO:

* since the multiphy behaviour has changed (where now a phymask of >1
  PHY will still be enumerated), multiphy setups may be quite wrong.
  I'll go and fix these so they still have a chance of working, at least.
  until the switch PHY support appears in -HEAD.

Submitted by: Stefan Bethke <stb@lassitu.de>

12 years agoBring over the first part of the etherswitch framework - an MDIO bus and
adrian [Tue, 1 May 2012 06:11:38 +0000 (06:11 +0000)]
Bring over the first part of the etherswitch framework - an MDIO bus and
MDIO/MII rendezvous proxy.

* Add an 'mdio' bus, which is the "IO" side of an MII bus (but by design
  can be anything which implements the underlying register access API.)
* Add 'miiproxy' and 'mdioproxy', which provides a rendezvous mechanism
  for MII busses to appear hanging off arbitrary busses (ie, that aren't
  necessarily a traditional looking MII bus.)

MII busses can now hang off anything that implements an mdiobus.

For the AR71xx SoC, there's one MDIO bus but two MII busses.  So to
properly support two or more real PHYs, this can be done:

  # arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
  hint.argemdio.0.at="nexus0"
  hint.argemdio.0.maddr=0x19000000
  hint.argemdio.0.msize=0x1000
  hint.argemdio.0.order=0

  # Create two mdioproxy instances
  hint.mdioproxy.0.at="mdio0"
  hint.mdioproxy.1.at="mdio0"

  # .. and with a follow-up patch
  hint.arge.0.mdio=mdioproxy0
  hint.arge.1.mdio=mdioproxy0

TODO:

* Do a sweep or two and add appropriate locking in mdio/mdioproxy/miiproxy.

Submitted by: Stefan Bethke <stb@lassitu.de>
Reviewed by: ray

12 years agoTeach ubldr(8) about simple MBR partitioning.
kientzle [Tue, 1 May 2012 05:04:49 +0000 (05:04 +0000)]
Teach ubldr(8) about simple MBR partitioning.

12 years agoMigrate ARGE_DEBUG to opt_arge.h.
adrian [Tue, 1 May 2012 04:35:53 +0000 (04:35 +0000)]
Migrate ARGE_DEBUG to opt_arge.h.

Submitted by: Stefan Bethke <stb@lassitu.de>

12 years agoAdd myself to this file - it didn't exist last time.
jwd [Tue, 1 May 2012 01:19:56 +0000 (01:19 +0000)]
Add myself to this file - it didn't exist last time.

Approved by: rmacklem (mentor)

12 years agoGNU/kFreeBSD portability fix. This glue <stdlib.h> overrides header protection
rmh [Mon, 30 Apr 2012 23:12:16 +0000 (23:12 +0000)]
GNU/kFreeBSD portability fix. This glue <stdlib.h> overrides header protection
in the system-wide version of <stdlib.h> by wrapping the #include_next
<stdlib.h> within the scope of its own header protection. On FreeBSD this has
no effect, since both header protections are equivalent. However the GNU version
of <stdlib.h> implements a special header protection mechanism which allows it
to be included multiple times (in different modes).

Simply by moving the #include_next off the header protection, we allow
system-wide <stdlib.h> to implement its own protection policy, whichever that
may be.

12 years agoUnbreak jemalloc build with MALLOC_PRODUCTION set. New jemalloc version
gonzo [Mon, 30 Apr 2012 22:46:09 +0000 (22:46 +0000)]
Unbreak jemalloc build with MALLOC_PRODUCTION set. New jemalloc version
uncovered MIPS-related gcc bug described in
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33256

The patch was obtained from r128198 in gcc-4_1-branch, which is GPLv2,
so it's OK to merge it.

12 years agoImport m4 regression tests from OpenBSD
bapt [Mon, 30 Apr 2012 22:00:34 +0000 (22:00 +0000)]
Import m4 regression tests from OpenBSD

Obtained from: OpenBSD
Approved by: des (mentor)

12 years agoAdd two special directives to libmap.conf:
bapt [Mon, 30 Apr 2012 21:26:35 +0000 (21:26 +0000)]
Add two special directives to libmap.conf:
include <file>:
  Parse the contents of file before continuing with the current file.
includedir <dir>:
  Parse the contents of every file in dir that ends in .conf before continuing
  with the current file.
Any file or directory encountered while processing include or includedir
directives will be parsed exactly once, even if it is encountered multiple
times.

Reviewed by: kib, des
Approved by: des (mentor)
MFC after: 1 month

12 years agoRespect mathematical operation order piority with the exponent gnu extension
bapt [Mon, 30 Apr 2012 21:02:57 +0000 (21:02 +0000)]
Respect mathematical operation order piority with the exponent gnu extension

Obtained from: OpenBSD
Approved by: des (mentor)

12 years agoAdd to GEOM RAID class module, supporting the DDF metadata format, as
mav [Mon, 30 Apr 2012 17:53:02 +0000 (17:53 +0000)]
Add to GEOM RAID class module, supporting the DDF metadata format, as
defined by the SNIA Common RAID Disk Data Format Specification v2.0.

Supports multiple volumes per array and multiple partitions per disk.
Supports standard big-endian and Adaptec's little-endian byte ordering.
Supports all single-layer RAID levels. Dual-layer RAID levels except
RAID10 are not supported now because of GEOM RAID design limitations.

Some work is still to be done, but the present code already manages basic
interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

12 years agoAdd myself.
dumbbell [Mon, 30 Apr 2012 16:16:37 +0000 (16:16 +0000)]
Add myself.

12 years agoImprove growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle
trasz [Mon, 30 Apr 2012 16:08:02 +0000 (16:08 +0000)]
Improve growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle
them and commit separately.

1. Rewrite the way growfs(8) finds the device and mount point.  This makes
   it possible to use e.g. "growfs /mnt"; it's also used to display more
   helpful messages.

2. Be more user-friendly, using descriptive messages, like this:

   OK to grow filesystem on /dev/md0, mounted on /mnt, from 9.8GB to 20GB? [Yes/No]"

3. Allow to specify the size (-s option) just like with mdconfig(8), i.e. with
   postfixes ("mdconfig -s 10g").

4. Reload read-only filesystem after growing.

Reviewed by: kib, mckusick (earlier version)
Sponsored by: The FreeBSD Foundation

12 years agoAdd GNU hash support for rtld.
kib [Mon, 30 Apr 2012 13:31:10 +0000 (13:31 +0000)]
Add GNU hash support for rtld.

Based on dragonflybsd support for GNU hash by John Marino <draco marino st>
Reviewed by: kan
Tested by: bapt
MFC after: 2 weeks

12 years agoSplit the symlook_obj1 into a loop iterating over the ELF object symbol
kib [Mon, 30 Apr 2012 13:29:21 +0000 (13:29 +0000)]
Split the symlook_obj1 into a loop iterating over the ELF object symbol
hash elements, and a helper matched_symbol() which match the given hash
entry and request, performing needed type and version checks.

Based on dragonflybsd support for GNU hash by John Marino <draco marino st>
Reviewed by: kan
Tested by: bapt
MFC after: 2 weeks

12 years agoDon't reuse credentials if redirected to a different host.
des [Mon, 30 Apr 2012 12:12:48 +0000 (12:12 +0000)]
Don't reuse credentials if redirected to a different host.

Submitted by: Niels Heinen <heinenn@google.com>
MFC after: 3 weeks

12 years agoSince the socket is non-blocking, it is necessary to use select(2) even
des [Mon, 30 Apr 2012 12:11:45 +0000 (12:11 +0000)]
Since the socket is non-blocking, it is necessary to use select(2) even
when there is no timeout, because read(2) will return immediately if there
is no data waiting in the TCP buffer, causing fetch_read() to busy-loop on
slow connections.

MFC after: 3 weeks
Noticed by: Yanhui Shen <shen.elf@gmail.com>

12 years agoRemove incorrect __restrict qualifier on several pointers
dumbbell [Mon, 30 Apr 2012 11:28:17 +0000 (11:28 +0000)]
Remove incorrect __restrict qualifier on several pointers

The typical case was:
static __inline int
convert_ccl(FILE *fp, char * __restrict p, [...])
{
        [...]

        if (p == SUPPRESS_PTR) {
[...]
} else {
[...]
}

[...]
}

This qualifier says that the pointer is the only one at that time
pointing to the resource.

Here, clang considers that "p" will never match "SUPPRESS_PTR" and
optimize the if{} block out. This leads to segfaults in programs calling
vfscanf(3) and vfwscanf(3) with just the format string (no arguments
following it).

The following softwares were reported to abort with segmentation fault
and this patch fixes it:
    o  cmake
    o  smartd
    o  devel/ORBit2

dim@ opened an LLVM PR to discuss this clang optimization:
    http://llvm.org/bugs/show_bug.cgi?id=12656

Tested by: bsam@

12 years agoMove several enums and structures required for L2 filtering from ip_fw_private.h...
melifaro [Mon, 30 Apr 2012 10:22:23 +0000 (10:22 +0000)]
Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h.
Remove ipfw/ip_fw_private.h header from non-ipfw code.

Approved by:        ae(mentor)
MFC after:          2 weeks

12 years agoChange the default to not use packet counters to generate rx interrupts.
np [Mon, 30 Apr 2012 09:46:05 +0000 (09:46 +0000)]
Change the default to not use packet counters to generate rx interrupts.
Rely solely on the timer based mechanism.

Update man page to reflect this change.

MFC after: 1 week

12 years agoAdd support for missing gauth_number_of_chunks field. This Bug was
tuexen [Mon, 30 Apr 2012 08:44:21 +0000 (08:44 +0000)]
Add support for missing gauth_number_of_chunks field. This Bug was
found by Irene Ruengeler.

MFC after: 1 week

12 years agoMake sure that the firmware version is available in
np [Mon, 30 Apr 2012 08:44:10 +0000 (08:44 +0000)]
Make sure that the firmware version is available in
dev.t4nex.X.firmware_version even if the driver fails to attach
properly.  At least it'll be easy to tell what we're dealing with.

MFC after: 1 week

12 years agofix a further typo in the pdfork(2) man page.
rwatson [Mon, 30 Apr 2012 08:00:52 +0000 (08:00 +0000)]
fix a further typo in the pdfork(2) man page.

Submitted by: Norman Hardy
MFC after: 3 days

12 years agoThe returned file descriptor from pdfork(2) is via fdp, not pidp.
rwatson [Mon, 30 Apr 2012 07:32:39 +0000 (07:32 +0000)]
The returned file descriptor from pdfork(2) is via fdp, not pidp.

Submitted by: Norman Hardy
MFC after: 3 days

12 years agoPrint out a warning message if a `lpc setstatus' is done when
gad [Mon, 30 Apr 2012 01:10:13 +0000 (01:10 +0000)]
Print out a warning message if a `lpc setstatus' is done when
the queue is not 'lpc stop'-ed.  In that situation `lpq' will
not display the status message to the user, and the operator
may think the queue is already stopped when it is not.

MFC after: 3 weeks

12 years agoFix a bug in *wscanf's handling of non-wide %s, %c, and %[
das [Mon, 30 Apr 2012 01:08:18 +0000 (01:08 +0000)]
Fix a bug in *wscanf's handling of non-wide %s, %c, and %[
conversions.  Both the specification and the documentation say the
width is interpreted as the max number of wide characters to read, but
the implementation was interpreting it as the number of bytes to convert.
(See also r105317.)

This change has security implications for any applications that depend
on the buggy behavior, but the impact in practice is probably nil.
Any such application would already be buggy on other platforms that
get the semantics right.  Also, these conversions are rarely used;
%ls, %lc, and %l[ are more appropriate.

12 years agoCatch the user-error when no queue name was specified on an
gad [Mon, 30 Apr 2012 00:54:10 +0000 (00:54 +0000)]
Catch the user-error when no queue name was specified on an
lpc-command which supports '-msg' (e.g.: setstatus).  Print
out a helpful error message instead hitting a seg-fault.

MFC after: 3 weeks

12 years agoCopy recent changes from etc/root/dot.cshrc that make the defaults more
eadler [Sun, 29 Apr 2012 22:29:48 +0000 (22:29 +0000)]
Copy recent changes from etc/root/dot.cshrc that make the defaults more
user friendly

Approved by: cperciva
MFC after: 3 days

12 years agoAdd support for:
eadler [Sun, 29 Apr 2012 22:28:15 +0000 (22:28 +0000)]
Add support for:
Olympus FE-210 camera
LG UP3S MP3 player
Laser MP3-2GA13 MP3

PR: usb/119201
Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>
Approved by: cperciva
MFC after: 1 week

12 years agopread(2) might fail with EBUSY, so document it
eadler [Sun, 29 Apr 2012 22:23:00 +0000 (22:23 +0000)]
pread(2) might fail with EBUSY, so document it

PR: docs/167201
Submitted by: Kurt Jaeger <fbsd-ports@opsec.eu>
Approved by: cperciva
MFC after: 3 days

12 years agoAllow users of gprof to get per run output files (using the pid)
eadler [Sun, 29 Apr 2012 22:19:58 +0000 (22:19 +0000)]
Allow users of gprof to get per run output files (using the pid)

PR: bin/99800
Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>
Reviewed by: jilles (code)
Reviewed by: dwhite (doc)
Approved by: cperciva
MFC after: 1 week

12 years agos/gmirror/graid/
mav [Sun, 29 Apr 2012 19:40:50 +0000 (19:40 +0000)]
s/gmirror/graid/

12 years agoAdd support for Multi-TT mode of modern USB HUBs.
hselasky [Sun, 29 Apr 2012 17:12:33 +0000 (17:12 +0000)]
Add support for Multi-TT mode of modern USB HUBs.
This will give you more bandwidth for isochronous
FULL speed applications connected through a
High Speed HUB.

This patch has been tested with XHCI and EHCI.

MFC after: 1 week

12 years agoPreviously, vfscanf()'s wide character processing functions were
das [Sun, 29 Apr 2012 16:28:39 +0000 (16:28 +0000)]
Previously, vfscanf()'s wide character processing functions were
reading wide characters manually.  With this change, they now use
fgetwc().  To make this work, we use an internal version of fgetwc()
with a few extensions: it takes an mbstate * because non-wide streams
don't have a built-in mbstate, and it indicates the number of bytes
read.

vfscanf() now resembles vfwscanf() more closely.  Minor functional
improvements include working xlocale support in vfscanf(), setting the
stream error indicator on encoding errors, and proper handling of
shift-based encodings.  (Actually, making shift-based encodings work
with non-wide streams is hopeless, but the implementation now matches
the broken specification.)

12 years agoPartially revert r232938; ZFS only requires nfs4 but not posix1e.
marius [Sun, 29 Apr 2012 16:21:47 +0000 (16:21 +0000)]
Partially revert r232938; ZFS only requires nfs4 but not posix1e.

Submitted by: jhb

12 years agoDrag in subr_acl_nfs4.c for ZFS automatically, otherwise it's
marius [Sun, 29 Apr 2012 16:14:09 +0000 (16:14 +0000)]
Drag in subr_acl_nfs4.c for ZFS automatically, otherwise it's
unintuitive that "options zfs" requires "options ufs_acl".

12 years agoAdd multiple inclusion protection.
marius [Sun, 29 Apr 2012 15:54:40 +0000 (15:54 +0000)]
Add multiple inclusion protection.

PR: 165025
Submitted by: Gavin Mu
MFC after: 1 week

12 years agoFix WITHOUT_EXAMPLES build:
bschmidt [Sun, 29 Apr 2012 12:48:52 +0000 (12:48 +0000)]
Fix WITHOUT_EXAMPLES build:
While removing unnecessary entries from .PATH.c I missed that for the
examples WPA_SUPPLICANT_DISTDIR/HOSTAPD_DISTDIR is explicitly added to
.PATH.

Tested by: lev
MFC after: 2 weeks

12 years agoAdd a convenience macro for the returns_twice attribute, and apply it to
dim [Sun, 29 Apr 2012 11:04:31 +0000 (11:04 +0000)]
Add a convenience macro for the returns_twice attribute, and apply it to
the prototypes of the appropriate functions (getcontext, savectx,
setjmp, sigsetjmp and vfork).

MFC after: 2 weeks

12 years agoRegenerate src.conf(5)
kib [Sun, 29 Apr 2012 09:37:02 +0000 (09:37 +0000)]
Regenerate src.conf(5)

12 years agoAdd src.conf option WITH_SHARED_TOOLCHAIN to enable building the
kib [Sun, 29 Apr 2012 09:32:44 +0000 (09:32 +0000)]
Add src.conf option WITH_SHARED_TOOLCHAIN to enable building the
toolchain binaries as dynamically linked.  Option is disabled by
default.

Reviewed by: ru (previous version)
MFC after: 2 weeks

12 years agoUse standard getopt(3) error message.
jlh [Sun, 29 Apr 2012 08:17:44 +0000 (08:17 +0000)]
Use standard getopt(3) error message.

Submitted by: jilles
Approved by: kib (mentor)

12 years agoChange cc -> bc : "bc" is "busy count", which is the % of time the channel
adrian [Sat, 28 Apr 2012 23:13:09 +0000 (23:13 +0000)]
Change cc -> bc : "bc" is "busy count", which is the % of time the channel
is considered "busy but not doing any active TX or frame RX."

Just keep in mind that "frame RX" is "decoding what looks like a wifi
signal", not necessarily "frame successfully decoded for this particular
device."

12 years agoAs cron(8) is started with '-s' by default, timezones that observe
gjb [Sat, 28 Apr 2012 22:48:00 +0000 (22:48 +0000)]
As cron(8) is started with '-s' by default, timezones that observe
DST should not need to worry about scheduling jobs when the DST time
changes.

Rather than removing the BUGS section in crontab(5) regarding this,
note that disabling '-s' may still cause jobs to be executed twice or
not at all.

PR: 166318
Submitted by: Florian k Unglaub (f.unglaub%googlemail!com)
MFC After: 1 week

12 years agoAfter thinking about this a bit more, let's not keep statistics per-channel
adrian [Sat, 28 Apr 2012 22:03:19 +0000 (22:03 +0000)]
After thinking about this a bit more, let's not keep statistics per-channel
in the HAL.  That's very memory hungry (32k just for channel statistics)
which would be better served by keeping a summary in the ANI state.

Or, later, keep a survey history in net80211.

So:

* Migrate the ah_chansurvey array to be a single entry, for the current
  channel.
* Change the ioctl interface and ANI code to just reference that.
* Clear the ah_chansurvey array during channel reset, both in the AR5212
  and AR5416 reset path.

12 years agoFix small documentation mistakes.
jlh [Sat, 28 Apr 2012 21:50:30 +0000 (21:50 +0000)]
Fix small documentation mistakes.

Submitted by: brueffer
Approved by: kib (mentor)

12 years agoImport stdbuf(1) and the shared library it relies on.
jlh [Sat, 28 Apr 2012 20:52:20 +0000 (20:52 +0000)]
Import stdbuf(1) and the shared library it relies on.
This tool changes the default buffering behaviour of standard
stdio streams.

It only works on dynamic binaries.  To make it work for static
ones it would require cluttering stdio because there no single
entry point.

PR: 166660
Reviewed by: current@, jhb
Approved by: kib (mentor)
MFC after: 1 week

12 years agoAs of r226840, GELI starts one thread per CPU.
gjb [Sat, 28 Apr 2012 20:23:13 +0000 (20:23 +0000)]
As of r226840, GELI starts one thread per CPU.

PR: 167382
Submitted by: John W. O'Brien (john%saltant.com)
X-Needs-MFC: r226840

12 years agoFix several memory and lock leaks on the out of memory condition.
kib [Sat, 28 Apr 2012 18:57:27 +0000 (18:57 +0000)]
Fix several memory and lock leaks on the out of memory condition.

Reported by: Matt Miller <matt matthewjmiller net>
MFC after: 1 week

12 years agoAlthough not strictly needed, quieten a compiler warning by a user.
adrian [Sat, 28 Apr 2012 18:56:17 +0000 (18:56 +0000)]
Although not strictly needed, quieten a compiler warning by a user.

12 years agoWhitespace changes.
tuexen [Sat, 28 Apr 2012 16:32:49 +0000 (16:32 +0000)]
Whitespace changes.

MFC after: 3 days