svn commit: r224242 - head/sys/dev/ath/ath_hal

2011-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 08:31:55 2011
New Revision: 224242
URL: http://svn.freebsd.org/changeset/base/224242

Log:
  This re-enables HT40 channels for use when DFS is enabled.
  
  These should be disabled for the AR5416 in hostap/mesh/ibss mode,
  as the AR5416 doesn't have support for radar detection on the
  ext channel of a HT40 setup. Later chips do.
  
  Approved by:  re (kib)

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

Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c
==
--- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jul 21 07:08:39 2011
(r224241)
+++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jul 21 08:31:55 2011
(r224242)
@@ -526,6 +526,7 @@ getchannels(struct ath_hal *ah,
"skip ecm channel\n");
continue;
}
+#if 0
if ((fband->useDfs & dfsMask) && 
(cm->flags & IEEE80211_CHAN_HT40)) {
/* NB: DFS and HT40 don't mix */
@@ -533,6 +534,7 @@ getchannels(struct ath_hal *ah,
"skip HT40 chan, DFS required\n");
continue;
}
+#endif
/*
 * Make sure that channel separation
 * meets the requirement.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224243 - in head/sys/dev/ath/ath_hal: ar5416 ar9001 ar9002

2011-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 08:35:10 2011
New Revision: 224243
URL: http://svn.freebsd.org/changeset/base/224243

Log:
  Break out the PLL setup into (mostly) per-chip methods, rather than
  polluting the AR5416 code with later chipset support.
  
  Note: ar9280InitPLL() supports Merlin (AR9280) and later (AR9285, AR9287.)
  
  Submitted by: ssgriffonu...@gmail.com
  Approved by:  re (kib)

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280.h
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Thu Jul 21 08:31:55 
2011(r224242)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Thu Jul 21 08:35:10 
2011(r224243)
@@ -1423,60 +1423,20 @@ ar5416UpdateChainMasks(struct ath_hal *a
 void
 ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
 {
-   uint32_t pll;
-
-   if (AR_SREV_MERLIN_20(ah) &&
-   chan != AH_NULL && IEEE80211_IS_CHAN_5GHZ(chan)) {
-   /*
-* PLL WAR for Merlin 2.0/2.1
-* When doing fast clock, set PLL to 0x142c
-* Else, set PLL to 0x2850 to prevent reset-to-reset variation 
-*/
-   pll = IS_5GHZ_FAST_CLOCK_EN(ah, chan) ? 0x142c : 0x2850;
-   } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) {
-   pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV);
-   if (chan != AH_NULL) {
-   if (IEEE80211_IS_CHAN_HALF(chan))
-   pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL);
-   else if (IEEE80211_IS_CHAN_QUARTER(chan))
-   pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL);
-
-   if (IEEE80211_IS_CHAN_5GHZ(chan))
-   pll |= SM(0x28, AR_RTC_SOWL_PLL_DIV);
-   else
-   pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV);
-
-   } else
-   pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV);
-   } else if (AR_SREV_SOWL_10_OR_LATER(ah)) {
-   pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV);
-   if (chan != AH_NULL) {
-   if (IEEE80211_IS_CHAN_HALF(chan))
-   pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL);
-   else if (IEEE80211_IS_CHAN_QUARTER(chan))
-   pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL);
-
-   if (IEEE80211_IS_CHAN_5GHZ(chan))
-   pll |= SM(0x50, AR_RTC_SOWL_PLL_DIV);
-   else
-   pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV);
-   } else
-   pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV);
-   } else {
-   pll = AR_RTC_PLL_REFDIV_5 | AR_RTC_PLL_DIV2;
-   if (chan != AH_NULL) {
-   if (IEEE80211_IS_CHAN_HALF(chan))
-   pll |= SM(0x1, AR_RTC_PLL_CLKSEL);
-   else if (IEEE80211_IS_CHAN_QUARTER(chan))
-   pll |= SM(0x2, AR_RTC_PLL_CLKSEL);
-
-   if (IEEE80211_IS_CHAN_5GHZ(chan))
-   pll |= SM(0xa, AR_RTC_PLL_DIV);
-   else
-   pll |= SM(0xb, AR_RTC_PLL_DIV);
-   } else
+   uint32_t pll = AR_RTC_PLL_REFDIV_5 | AR_RTC_PLL_DIV2;
+   if (chan != AH_NULL) {
+   if (IEEE80211_IS_CHAN_HALF(chan))
+   pll |= SM(0x1, AR_RTC_PLL_CLKSEL);
+   else if (IEEE80211_IS_CHAN_QUARTER(chan))
+   pll |= SM(0x2, AR_RTC_PLL_CLKSEL);
+
+   if (IEEE80211_IS_CHAN_5GHZ(chan))
+   pll |= SM(0xa, AR_RTC_PLL_DIV);
+   else
pll |= SM(0xb, AR_RTC_PLL_DIV);
-   }
+   } else
+   pll |= SM(0xb, AR_RTC_PLL_DIV);
+   
OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
 
/* TODO:

Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jul 21 08:31:55 
2011(r224242)
+++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jul 21 08:35:10 
2011(r224243)
@@ -86,6 +86,28 @@ ar9160AniSetup(struct ath_hal *ah)
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
 }
 
+static void 
+ar9160InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+   uint32_t pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV);
+   if (chan != AH_NULL) {
+   if (IEEE80211_IS

Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys

2011-07-21 Thread Attilio Rao
2011/7/20 Pan Tsu :
> Attilio Rao  writes:
>
>> Author: attilio
>> Date: Tue Jul 19 13:00:30 2011
>> New Revision: 224217
>> URL: http://svn.freebsd.org/changeset/base/224217
>>
>> Log:
>>   Bump MAXCPU for amd64, ia64 and XLP mips appropriately.
>>   From now on, default values for FreeBSD will be 64 maxiumum supported
>>   CPUs on amd64 and ia64 and 128 for XLP. All the other architectures
>>   seem already capped appropriately (with the exception of sparc64 which
>>   needs further support on jalapeno flavour).
>>
>>   Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced
>>   during the infrastructure cleanup for supporting MAXCPU > 32. This
>>   covers cpumask_t retiral too.
>>
>>   The switch is considered completed at the present time, so for whatever
>>   bug you may experience that is reconducible to that area, please report
>>   immediately.
>>
>>   Requested by:       marcel, jchandra
>>   Tested by:  pluknet, sbruno
>>   Approved by:        re (kib)
>>
>> Modified:
>>   head/sys/amd64/include/param.h
>>   head/sys/ia64/include/param.h
>>   head/sys/mips/conf/XLP
>>   head/sys/mips/conf/XLP64
>>   head/sys/mips/conf/XLPN32
>>   head/sys/sys/param.h
>>
>> Modified: head/sys/amd64/include/param.h
>> ==
>> --- head/sys/amd64/include/param.h    Tue Jul 19 12:41:57 2011        
>> (r224216)
>> +++ head/sys/amd64/include/param.h    Tue Jul 19 13:00:30 2011        
>> (r224217)
>> @@ -65,7 +65,7 @@
>>
>>  #if defined(SMP) || defined(KLD_MODULE)
>>  #ifndef MAXCPU
>> -#define MAXCPU               32
>> +#define MAXCPU               64
>>  #endif
>>  #else
>>  #define MAXCPU               1
>
> Do you plan to bump MEMSTAT_MAXCPU, too?
>
>  $ vmstat -z
>  vmstat: memstat_sysctl_uma: Too many CPUs
>  $ vmstat -m
>  vmstat: memstat_sysctl_malloc: Too many CPUs
>
>  $ sysctl kern. | grep smp.\*cpus
>  kern.smp.maxcpus: 64
>  kern.smp.cpus: 2
>

Jz, we seriously need to fix this getting rid of the static values.

Anyway, can you try the following patch?:
http://www.freebsd.org/~attilio/memstat_maxcpu.diff

It is going to add some memory overhead for i386 case.

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys

2011-07-21 Thread Sergey Kandaurov
On 21 July 2011 14:14, Attilio Rao  wrote:
> 2011/7/20 Pan Tsu :
>> Attilio Rao  writes:
>>
>>> Author: attilio
>>> Date: Tue Jul 19 13:00:30 2011
>>> New Revision: 224217
>>> URL: http://svn.freebsd.org/changeset/base/224217
>>>
>>> Log:
>>>   Bump MAXCPU for amd64, ia64 and XLP mips appropriately.
>>>   From now on, default values for FreeBSD will be 64 maxiumum supported
>>>   CPUs on amd64 and ia64 and 128 for XLP. All the other architectures
>>>   seem already capped appropriately (with the exception of sparc64 which
>>>   needs further support on jalapeno flavour).
>>>
>>>   Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced
>>>   during the infrastructure cleanup for supporting MAXCPU > 32. This
>>>   covers cpumask_t retiral too.
>>>
>>>   The switch is considered completed at the present time, so for whatever
>>>   bug you may experience that is reconducible to that area, please report
>>>   immediately.
>>>
>>>   Requested by:       marcel, jchandra
>>>   Tested by:  pluknet, sbruno
>>>   Approved by:        re (kib)
>>>
>>> Modified:
>>>   head/sys/amd64/include/param.h
>>>   head/sys/ia64/include/param.h
>>>   head/sys/mips/conf/XLP
>>>   head/sys/mips/conf/XLP64
>>>   head/sys/mips/conf/XLPN32
>>>   head/sys/sys/param.h
>>>
>>> Modified: head/sys/amd64/include/param.h
>>> ==
>>> --- head/sys/amd64/include/param.h    Tue Jul 19 12:41:57 2011        
>>> (r224216)
>>> +++ head/sys/amd64/include/param.h    Tue Jul 19 13:00:30 2011        
>>> (r224217)
>>> @@ -65,7 +65,7 @@
>>>
>>>  #if defined(SMP) || defined(KLD_MODULE)
>>>  #ifndef MAXCPU
>>> -#define MAXCPU               32
>>> +#define MAXCPU               64
>>>  #endif
>>>  #else
>>>  #define MAXCPU               1
>>
>> Do you plan to bump MEMSTAT_MAXCPU, too?
>>
>>  $ vmstat -z
>>  vmstat: memstat_sysctl_uma: Too many CPUs
>>  $ vmstat -m
>>  vmstat: memstat_sysctl_malloc: Too many CPUs
>>
>>  $ sysctl kern. | grep smp.\*cpus
>>  kern.smp.maxcpus: 64
>>  kern.smp.cpus: 2
>>
>
> Jz, we seriously need to fix this getting rid of the static values.
>
> Anyway, can you try the following patch?:
> http://www.freebsd.org/~attilio/memstat_maxcpu.diff
>
> It is going to add some memory overhead for i386 case.
>

It looks good as a temporal fix.
I'm running with this patch for several days
(I bumped MEMSTAT_MAXCPU to 128 though).

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


Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys

2011-07-21 Thread Sergey Kandaurov
On 21 July 2011 14:14, Attilio Rao  wrote:
> 2011/7/20 Pan Tsu :
>> Attilio Rao  writes:
>>
>>> Author: attilio
>>> Date: Tue Jul 19 13:00:30 2011
>>> New Revision: 224217
>>> URL: http://svn.freebsd.org/changeset/base/224217
>>>
>>> Log:
>>>   Bump MAXCPU for amd64, ia64 and XLP mips appropriately.
>>>   From now on, default values for FreeBSD will be 64 maxiumum supported
>>>   CPUs on amd64 and ia64 and 128 for XLP. All the other architectures
>>>   seem already capped appropriately (with the exception of sparc64 which
>>>   needs further support on jalapeno flavour).
>>>
>>>   Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced
>>>   during the infrastructure cleanup for supporting MAXCPU > 32. This
>>>   covers cpumask_t retiral too.
>>>
>>>   The switch is considered completed at the present time, so for whatever
>>>   bug you may experience that is reconducible to that area, please report
>>>   immediately.
>>>
>>>   Requested by:       marcel, jchandra
>>>   Tested by:  pluknet, sbruno
>>>   Approved by:        re (kib)
>>>
>>> Modified:
>>>   head/sys/amd64/include/param.h
>>>   head/sys/ia64/include/param.h
>>>   head/sys/mips/conf/XLP
>>>   head/sys/mips/conf/XLP64
>>>   head/sys/mips/conf/XLPN32
>>>   head/sys/sys/param.h
>>>
>>> Modified: head/sys/amd64/include/param.h
>>> ==
>>> --- head/sys/amd64/include/param.h    Tue Jul 19 12:41:57 2011        
>>> (r224216)
>>> +++ head/sys/amd64/include/param.h    Tue Jul 19 13:00:30 2011        
>>> (r224217)
>>> @@ -65,7 +65,7 @@
>>>
>>>  #if defined(SMP) || defined(KLD_MODULE)
>>>  #ifndef MAXCPU
>>> -#define MAXCPU               32
>>> +#define MAXCPU               64
>>>  #endif
>>>  #else
>>>  #define MAXCPU               1
>>
>> Do you plan to bump MEMSTAT_MAXCPU, too?
>>
>>  $ vmstat -z
>>  vmstat: memstat_sysctl_uma: Too many CPUs
>>  $ vmstat -m
>>  vmstat: memstat_sysctl_malloc: Too many CPUs
>>
>>  $ sysctl kern. | grep smp.\*cpus
>>  kern.smp.maxcpus: 64
>>  kern.smp.cpus: 2
>>
>
> Jz, we seriously need to fix this getting rid of the static values.
>
> Anyway, can you try the following patch?:
> http://www.freebsd.org/~attilio/memstat_maxcpu.diff
>
> It is going to add some memory overhead for i386 case.
>

Something like this should work (vmstat -z, vmstat -m both work).
It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime.
http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff

Probably it should work with maxid, instead of maxcpu to save some memory.
Though, using maxcpu is more safe.

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


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

2011-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 14:16:42 2011
New Revision: 224244
URL: http://svn.freebsd.org/changeset/base/224244

Log:
  Modify the radar API a little to be easier to "change" via run-time
  tools.
  
  * introduce pe_enabled, which (will) indicate whether the radar
detection stuff is enabled or not. Right now it's incorrectly
set, based on something previously written. I'll sort it out
later.
  
  * Don't set HAL_PHYERR_PARAM_ENABLE in pe_relstep to say whether
radar detection is on.
  
  * Return whether blockradar, fir128 and enmaxrssi is enabled.
  
  * Change some of the phyerr params to be integers rather than
HAL_BOOL so they can be set to the NOPARAM value when the
setup function is called. This is in line with other radar
parameters.
  
  * Add new configuration parameters for fir128, blockradar and
enmaxrssi, rather than defaulting to off, on and on respectively.
  
  Approved by:  re (kib)

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

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Thu Jul 21 08:35:10 2011
(r224243)
+++ head/sys/dev/ath/ath_hal/ah.h   Thu Jul 21 14:16:42 2011
(r224244)
@@ -718,17 +718,18 @@ typedef struct {
u_int32_t   pe_relpwr;  /* Relative power threshold in 0.5dB 
steps */
u_int32_t   pe_relstep; /* Pulse Relative step threshold in 
0.5dB steps */
u_int32_t   pe_maxlen;  /* Max length of radar sign in 0.8us 
units */
-   HAL_BOOLpe_usefir128;   /* Use the average in-band power 
measured over 128 cycles */
-   HAL_BOOLpe_blockradar;  /*
+   int32_t pe_usefir128;   /* Use the average in-band power 
measured over 128 cycles */
+   int32_t pe_blockradar;  /*
 * Enable to block radar check if pkt 
detect is done via OFDM
 * weak signal detect or pkt is 
detected immediately after tx
 * to rx transition
 */
-   HAL_BOOLpe_enmaxrssi;   /*
+   int32_t pe_enmaxrssi;   /*
 * Enable to use the max rssi instead 
of the last rssi during
 * fine gain changes for radar detection
 */
-   HAL_BOOLpe_extchannel;  /* Enable DFS on ext channel */
+   int32_t pe_extchannel;  /* Enable DFS on ext channel */
+   int32_t pe_enabled; /* Whether radar detection is enabled */
 } HAL_PHYERR_PARAM;
 
 #defineHAL_PHYERR_PARAM_NOVAL  65535

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c   Thu Jul 21 08:35:10 
2011(r224243)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c   Thu Jul 21 14:16:42 
2011(r224244)
@@ -617,10 +617,20 @@ ar5416GetDfsThresh(struct ath_hal *ah, H
temp = val & AR_PHY_RADAR_1_RELSTEP_CHECK;
pe->pe_relstep = MS(val, AR_PHY_RADAR_1_RELSTEP_THRESH);
if (temp)
-   pe->pe_relstep |= HAL_PHYERR_PARAM_ENABLE;
+   pe->pe_enabled = 1;
+   else
+   pe->pe_enabled = 0;
+
pe->pe_maxlen = MS(val, AR_PHY_RADAR_1_MAXLEN);
pe->pe_extchannel = !! (OS_REG_READ(ah, AR_PHY_RADAR_EXT) &
AR_PHY_RADAR_EXT_ENA);
+
+   pe->pe_usefir128 = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) &
+   AR_PHY_RADAR_1_USE_FIR128);
+   pe->pe_blockradar = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) &
+   AR_PHY_RADAR_1_BLOCK_CHECK);
+   pe->pe_enmaxrssi = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) &
+   AR_PHY_RADAR_1_MAX_RRSSI);
 }
 
 /*
@@ -660,8 +670,20 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_
 
OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA);
 
-   val = OS_REG_READ(ah, AR_PHY_RADAR_1);
-   val |= (AR_PHY_RADAR_1_MAX_RRSSI | AR_PHY_RADAR_1_BLOCK_CHECK);
+   if (pe->pe_usefir128 == 0)
+   OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128);
+   else if (pe->pe_usefir128 == 1)
+   OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128);
+
+   if (pe->pe_enmaxrssi == 0)
+   OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI);
+   else if (pe->pe_enmaxrssi == 1)
+   OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI);
+
+   if (pe->pe_blockradar == 0)
+   OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK);
+   else if (pe->pe_blockradar == 1)
+   OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK);
 
if (pe->pe_maxlen != HAL_PHY

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

2011-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 14:25:12 2011
New Revision: 224245
URL: http://svn.freebsd.org/changeset/base/224245

Log:
  This links in the ath dfs ioctl into the driver and defines the
  ioctl interface for DFS modules to use.
  
  Since there's no open source dfs code yet, this doesn't introduce any
  operational changes.
  
  Approved by:  re (kib)

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athioctl.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Thu Jul 21 14:16:42 2011(r224244)
+++ head/sys/dev/ath/if_ath.c   Thu Jul 21 14:25:12 2011(r224245)
@@ -5344,6 +5344,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
case SIOCGATHDIAG:
error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
break;
+   case SIOCGATHPHYERR:
+   error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr);
+   break;
 #endif
case SIOCGIFADDR:
error = ether_ioctl(ifp, cmd, data);

Modified: head/sys/dev/ath/if_athioctl.h
==
--- head/sys/dev/ath/if_athioctl.h  Thu Jul 21 14:16:42 2011
(r224244)
+++ head/sys/dev/ath/if_athioctl.h  Thu Jul 21 14:25:12 2011
(r224245)
@@ -154,6 +154,7 @@ struct ath_diag {
 
 };
 #defineSIOCGATHDIAG_IOWR('i', 138, struct ath_diag)
+#defineSIOCGATHPHYERR  _IOWR('i', 140, struct ath_diag)
 
 /*
  * Radio capture format.
@@ -205,4 +206,34 @@ struct ath_tx_radiotap_header {
int8_t  wt_chan_maxpow;
 } __packed;
 
+/*
+ * DFS ioctl commands
+ */
+
+#defineDFS_SET_THRESH  2
+#defineDFS_GET_THRESH  3
+#defineDFS_RADARDETECTS6
+
+/*
+ * DFS ioctl parameter types
+ */
+#define DFS_PARAM_FIRPWR   1
+#define DFS_PARAM_RRSSI2
+#define DFS_PARAM_HEIGHT   3
+#define DFS_PARAM_PRSSI4
+#define DFS_PARAM_INBAND   5
+#define DFS_PARAM_NOL  6   /* XXX not used in FreeBSD */
+#define DFS_PARAM_RELSTEP_EN   7
+#define DFS_PARAM_RELSTEP  8
+#define DFS_PARAM_RELPWR_EN9
+#define DFS_PARAM_RELPWR   10
+#define DFS_PARAM_MAXLEN   11
+#define DFS_PARAM_USEFIR12812
+#define DFS_PARAM_BLOCKRADAR   13
+#define DFS_PARAM_MAXRSSI_EN   14
+
+/* FreeBSD-specific start at 32 */
+#defineDFS_PARAM_ENABLE32
+#defineDFS_PARAM_EN_EXTCH  33
+
 #endif /* _DEV_ATH_ATHIOCTL_H */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys

2011-07-21 Thread John Baldwin
On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote:
> On 21 July 2011 14:14, Attilio Rao  wrote:
> > 2011/7/20 Pan Tsu :
> >> Attilio Rao  writes:
> >>
> >>> Author: attilio
> >>> Date: Tue Jul 19 13:00:30 2011
> >>> New Revision: 224217
> >>> URL: http://svn.freebsd.org/changeset/base/224217
> >>>
> >>> Log:
> >>>   Bump MAXCPU for amd64, ia64 and XLP mips appropriately.
> >>>   From now on, default values for FreeBSD will be 64 maxiumum supported
> >>>   CPUs on amd64 and ia64 and 128 for XLP. All the other architectures
> >>>   seem already capped appropriately (with the exception of sparc64 which
> >>>   needs further support on jalapeno flavour).
> >>>
> >>>   Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced
> >>>   during the infrastructure cleanup for supporting MAXCPU > 32. This
> >>>   covers cpumask_t retiral too.
> >>>
> >>>   The switch is considered completed at the present time, so for 
whatever
> >>>   bug you may experience that is reconducible to that area, please 
report
> >>>   immediately.
> >>>
> >>>   Requested by:   marcel, jchandra
> >>>   Tested by:  pluknet, sbruno
> >>>   Approved by:re (kib)
> >>>
> >>> Modified:
> >>>   head/sys/amd64/include/param.h
> >>>   head/sys/ia64/include/param.h
> >>>   head/sys/mips/conf/XLP
> >>>   head/sys/mips/conf/XLP64
> >>>   head/sys/mips/conf/XLPN32
> >>>   head/sys/sys/param.h
> >>>
> >>> Modified: head/sys/amd64/include/param.h
> >>> 
==
> >>> --- head/sys/amd64/include/param.hTue Jul 19 12:41:57 2011   
 (r224216)
> >>> +++ head/sys/amd64/include/param.hTue Jul 19 13:00:30 2011   
 (r224217)
> >>> @@ -65,7 +65,7 @@
> >>>
> >>>  #if defined(SMP) || defined(KLD_MODULE)
> >>>  #ifndef MAXCPU
> >>> -#define MAXCPU   32
> >>> +#define MAXCPU   64
> >>>  #endif
> >>>  #else
> >>>  #define MAXCPU   1
> >>
> >> Do you plan to bump MEMSTAT_MAXCPU, too?
> >>
> >>  $ vmstat -z
> >>  vmstat: memstat_sysctl_uma: Too many CPUs
> >>  $ vmstat -m
> >>  vmstat: memstat_sysctl_malloc: Too many CPUs
> >>
> >>  $ sysctl kern. | grep smp.\*cpus
> >>  kern.smp.maxcpus: 64
> >>  kern.smp.cpus: 2
> >>
> >
> > Jz, we seriously need to fix this getting rid of the static values.
> >
> > Anyway, can you try the following patch?:
> > http://www.freebsd.org/~attilio/memstat_maxcpu.diff
> >
> > It is going to add some memory overhead for i386 case.
> >
> 
> Something like this should work (vmstat -z, vmstat -m both work).
> It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime.
> http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff
> 
> Probably it should work with maxid, instead of maxcpu to save some memory.
> Though, using maxcpu is more safe.

Actually, I would prefer that it use mp_maxid as that is the general variable
things should use.  mp_maxcpus is a concession for the few places that may 
need to know the MAXCPUS value (e.g. if using libkvm to access a structure in 
a crashdump or live kernel that has a member array with MAXCPU elements).  
Code that just wants to allocate memory to hold per-CPU data should use 
mp_maxid whenever possible.

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


svn commit: r224246 - head/lib/libc/amd64/string

2011-07-21 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul 21 16:32:13 2011
New Revision: 224246
URL: http://svn.freebsd.org/changeset/base/224246

Log:
  Make both stpcpy and strcpy be assembly language implementations
  on amd64.
  
  Submitted by: Guillaume Morin (guillaume at morinfr.org)
  Reviewed by:  kib, jhb
  Approved by:  re (bz)
  MFC after:1 month

Added:
  head/lib/libc/amd64/string/stpcpy.S
 - copied, changed from r223967, head/lib/libc/amd64/string/strcpy.S
  head/lib/libc/amd64/string/strcpy.c   (contents, props changed)
Deleted:
  head/lib/libc/amd64/string/strcpy.S
Modified:
  head/lib/libc/amd64/string/Makefile.inc

Modified: head/lib/libc/amd64/string/Makefile.inc
==
--- head/lib/libc/amd64/string/Makefile.inc Thu Jul 21 14:25:12 2011
(r224245)
+++ head/lib/libc/amd64/string/Makefile.inc Thu Jul 21 16:32:13 2011
(r224246)
@@ -1,4 +1,4 @@
 # $FreeBSD$
 
 MDSRCS+= bcmp.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \
-   strcat.S strcmp.S strcpy.S
+   strcat.S strcmp.S stpcpy.S strcpy.c

Copied and modified: head/lib/libc/amd64/string/stpcpy.S (from r223967, 
head/lib/libc/amd64/string/strcpy.S)
==
--- head/lib/libc/amd64/string/strcpy.S Tue Jul 12 20:38:42 2011
(r223967, copy source)
+++ head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 16:32:13 2011
(r224246)
@@ -1,17 +1,14 @@
 /*
- * Written by J.T. Conklin 
+ * Adapted by Guillaume Morin  from strcpy.S
+ * written by J.T. Conklin 
  * Public domain.
  */
 
 #include 
 __FBSDID("$FreeBSD$");
 
-#if 0
-   RCSID("$NetBSD: strcpy.S,v 1.3 2004/07/19 20:04:41 drochner Exp $")
-#endif
-
 /*
- * This strcpy implementation copies a byte at a time until the
+ * This stpcpy implementation copies a byte at a time until the
  * source pointer is aligned to a word boundary, it then copies by
  * words until it finds a word containing a zero byte, and finally
  * copies by bytes until the end of the string is reached.
@@ -23,10 +20,11 @@ __FBSDID("$FreeBSD$");
  * requirements.
  */
 
-ENTRY(strcpy)
-   movq%rdi,%rax
-   movabsq $0x0101010101010101,%r8
-   movabsq $0x8080808080808080,%r9
+   .globl  stpcpy,__stpcpy
+ENTRY(stpcpy)
+__stpcpy:
+   movabsq $0x0101010101010101,%r8
+   movabsq $0x8080808080808080,%r9
 
/*
 * Align source to a word boundary.
@@ -41,6 +39,8 @@ ENTRY(strcpy)
incq%rdi
testb   %dl,%dl
jne .Lalign
+   movq%rdi,%rax
+   dec %rax
ret
 
.p2align 4
@@ -61,54 +61,56 @@ ENTRY(strcpy)
 */
 
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 1st byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 2nd byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 3rd byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 4th byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 5th byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 6th byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
-   incq%rdi
testb   %dl,%dl /* 7th byte == 0? */
je  .Ldone
+   incq%rdi
 
shrq$8,%rdx
movb%dl,(%rdi)
incq%rdi
testb   %dl,%dl /* 8th byte == 0? */
jne .Lword_aligned
+   decq%rdi
 
 .Ldone:
+   movq%rdi,%rax
ret
-END(strcpy)
-
+END(stpcpy)
+   
.section .note.GNU-stack,"",%progbits

Added: head/lib/libc/amd64/string/strcpy.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/amd64/string/strcpy.c Thu Jul 21 16:32:13 2011
(r224246)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2011 George V. Neville-Neil. All rights reserved.
+ *
+ * The compilation of software known as FreeBSD is distributed under the
+ * following terms:
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the a

svn commit: r224250 - head/usr.sbin/diskinfo

2011-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 19:39:40 2011
New Revision: 224250
URL: http://svn.freebsd.org/changeset/base/224250

Log:
  Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB.
  Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array.
  
  Approved by:  re (kib)

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

Modified: head/usr.sbin/diskinfo/diskinfo.c
==
--- head/usr.sbin/diskinfo/diskinfo.c   Thu Jul 21 19:07:38 2011
(r224249)
+++ head/usr.sbin/diskinfo/diskinfo.c   Thu Jul 21 19:39:40 2011
(r224250)
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -171,7 +172,7 @@ static char sector[65536];
 static char mega[1024 * 1024];
 
 static void
-rdsect(int fd, u_int blockno, u_int sectorsize)
+rdsect(int fd, off_t blockno, u_int sectorsize)
 {
int error;
 
@@ -232,21 +233,27 @@ TR(double count)
 static void
 speeddisk(int fd, off_t mediasize, u_int sectorsize)
 {
-   int i;
-   uint b0, b1, sectorcount;
+   int bulk, i;
+   off_t b0, b1, sectorcount, step;
 
sectorcount = mediasize / sectorsize;
+   step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1);
+   if (step > 16384)
+   step = 16384;
+   bulk = mediasize / (1024 * 1024);
+   if (bulk > 100)
+   bulk = 100;
 
printf("Seek times:\n");
printf("\tFull stroke:\t");
b0 = 0;
-   b1 = sectorcount - 1 - 16384;
+   b1 = sectorcount - step;
T0();
for (i = 0; i < 125; i++) {
rdsect(fd, b0, sectorsize);
-   b0 += 16384;
+   b0 += step;
rdsect(fd, b1, sectorsize);
-   b1 -= 16384;
+   b1 -= step;
}
TN(250);
 
@@ -256,9 +263,9 @@ speeddisk(int fd, off_t mediasize, u_int
T0();
for (i = 0; i < 125; i++) {
rdsect(fd, b0, sectorsize);
-   b0 += 16384;
+   b0 += step;
rdsect(fd, b1, sectorsize);
-   b1 += 16384;
+   b1 += step;
}
TN(250);
printf("\tQuarter stroke:\t");
@@ -267,9 +274,9 @@ speeddisk(int fd, off_t mediasize, u_int
T0();
for (i = 0; i < 250; i++) {
rdsect(fd, b0, sectorsize);
-   b0 += 16384;
+   b0 += step;
rdsect(fd, b1, sectorsize);
-   b1 += 16384;
+   b1 += step;
}
TN(500);
 
@@ -278,7 +285,7 @@ speeddisk(int fd, off_t mediasize, u_int
T0();
for (i = 0; i < 400; i++) {
rdsect(fd, b0, sectorsize);
-   b0 += 16384;
+   b0 += step;
}
TN(400);
 
@@ -287,7 +294,7 @@ speeddisk(int fd, off_t mediasize, u_int
T0();
for (i = 0; i < 400; i++) {
rdsect(fd, b0, sectorsize);
-   b0 -= 16384;
+   b0 -= step;
}
TN(400);
 
@@ -301,7 +308,7 @@ speeddisk(int fd, off_t mediasize, u_int
TN(2048);
 
printf("\tSeq inner:\t");
-   b0 = sectorcount - 2048 - 1;
+   b0 = sectorcount - 2048;
T0();
for (i = 0; i < 2048; i++) {
rdsect(fd, b0, sectorsize);
@@ -313,28 +320,28 @@ speeddisk(int fd, off_t mediasize, u_int
printf("\toutside: ");
rdsect(fd, 0, sectorsize);
T0();
-   for (i = 0; i < 100; i++) {
+   for (i = 0; i < bulk; i++) {
rdmega(fd);
}
-   TR(100 * 1024);
+   TR(bulk * 1024);
 
printf("\tmiddle:  ");
-   b0 = sectorcount / 2;
+   b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1;
rdsect(fd, b0, sectorsize);
T0();
-   for (i = 0; i < 100; i++) {
+   for (i = 0; i < bulk; i++) {
rdmega(fd);
}
-   TR(100 * 1024);
+   TR(bulk * 1024);
 
printf("\tinside:  ");
-   b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;;
+   b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;;
rdsect(fd, b0, sectorsize);
T0();
-   for (i = 0; i < 100; i++) {
+   for (i = 0; i < bulk; i++) {
rdmega(fd);
}
-   TR(100 * 1024);
+   TR(bulk * 1024);
 
printf("\n");
return;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224251 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2011-07-21 Thread Xin LI
Author: delphij
Date: Thu Jul 21 20:01:51 2011
New Revision: 224251
URL: http://svn.freebsd.org/changeset/base/224251

Log:
  A different implementation of r224231 proposed by pjd@,
  which does not require change in the znode structure.
  Specifically, it queries rdev from the znode in the
  same sa_bulk_lookup already done in zfs_getattr().
  
  Submitted by: pjd (with some revisions)
  Reviewed by:  pjd, mm
  Approved by:  re (kib)

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jul 
21 19:39:40 2011(r224250)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jul 
21 20:01:51 2011(r224251)
@@ -209,7 +209,6 @@ typedef struct znode {
boolean_t   z_is_sa;/* are we native sa? */
/* FreeBSD-specific field. */
struct task z_task;
-   dev_t   z_rdev;
 } znode_t;
 
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 
21 19:39:40 2011(r224250)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 
21 20:01:51 2011(r224251)
@@ -2642,11 +2642,11 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i
uint32_t blksize;
u_longlong_t nblocks;
uint64_t links;
-   uint64_t mtime[2], ctime[2], crtime[2];
+   uint64_t mtime[2], ctime[2], crtime[2], rdev;
xvattr_t *xvap = (xvattr_t *)vap;   /* vap may be an xvattr_t * */
xoptattr_t *xoap = NULL;
boolean_t skipaclchk = (flags & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE;
-   sa_bulk_attr_t bulk[3];
+   sa_bulk_attr_t bulk[4];
int count = 0;
 
ZFS_ENTER(zfsvfs);
@@ -2657,6 +2657,9 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL, &mtime, 16);
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &ctime, 16);
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &crtime, 16);
+   if (vp->v_type == VBLK || vp->v_type == VCHR)
+   SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_RDEV(zfsvfs), NULL,
+   &rdev, 8);
 
if ((error = sa_bulk_lookup(zp->z_sa_hdl, bulk, count)) != 0) {
ZFS_EXIT(zfsvfs);
@@ -2694,7 +2697,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i
vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */
vap->va_size = zp->z_size;
vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
-   vap->va_rdev = zp->z_rdev;
+   if (vp->v_type == VBLK || vp->v_type == VCHR)
+   vap->va_rdev = zfs_cmpldev(rdev);
vap->va_seq = zp->z_seq;
vap->va_flags = 0;  /* FreeBSD: Reset chflags(2) flags. */
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 
21 19:39:40 2011(r224250)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 
21 20:01:51 2011(r224251)
@@ -700,6 +700,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
case VDIR:
zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */
break;
+#ifdef sun
case VBLK:
case VCHR:
{
@@ -707,9 +708,10 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
VERIFY(sa_lookup(zp->z_sa_hdl, SA_ZPL_RDEV(zfsvfs),
&rdev, sizeof (rdev)) == 0);
 
-   zp->z_rdev = zfs_cmpldev(rdev);
+   vp->v_rdev = zfs_cmpldev(rdev);
}
break;
+#endif /* sun */
case VFIFO:
vp->v_op = &zfs_fifoops;
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224252 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2011-07-21 Thread Xin LI
Author: delphij
Date: Thu Jul 21 20:02:22 2011
New Revision: 224252
URL: http://svn.freebsd.org/changeset/base/224252

Log:
  Bring the code more in-line with OpenSolaris source to
  ease future port.
  
  Reviewed by:  pjd, mm
  Approved by:  re (kib)

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 
21 20:01:51 2011(r224251)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 
21 20:02:22 2011(r224252)
@@ -2688,7 +2688,11 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i
mutex_enter(&zp->z_lock);
vap->va_type = IFTOVT(zp->z_mode);
vap->va_mode = zp->z_mode & ~S_IFMT;
-// vap->va_fsid = zp->z_zfsvfs->z_vfs->vfs_dev;
+#ifdef sun
+   vap->va_fsid = zp->z_zfsvfs->z_vfs->vfs_dev;
+#else
+   vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
+#endif
vap->va_nodeid = zp->z_id;
if ((vp->v_flag & VROOT) && zfs_show_ctldir(zp))
links = zp->z_links + 1;
@@ -2696,9 +2700,12 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i
links = zp->z_links;
vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */
vap->va_size = zp->z_size;
-   vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
+#ifdef sun
+   vap->va_rdev = vp->v_rdev;
+#else
if (vp->v_type == VBLK || vp->v_type == VCHR)
vap->va_rdev = zfs_cmpldev(rdev);
+#endif
vap->va_seq = zp->z_seq;
vap->va_flags = 0;  /* FreeBSD: Reset chflags(2) flags. */
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 
21 20:01:51 2011(r224251)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 
21 20:02:22 2011(r224252)
@@ -713,6 +713,10 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
break;
 #endif /* sun */
case VFIFO:
+#ifdef sun
+   case VSOCK:
+   case VDOOR:
+#endif /* sun */
vp->v_op = &zfs_fifoops;
break;
case VREG:
@@ -721,6 +725,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
vp->v_op = &zfs_shareops;
}
break;
+#ifdef sun
+   case VLNK:
+   vn_setops(vp, zfs_symvnodeops);
+   break;
+   default:
+   vn_setops(vp, zfs_evnodeops);
+   break;
+#endif /* sun */
}
if (vp->v_type != VFIFO)
VN_LOCK_ASHARE(vp);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224253 - head/lib/libc/amd64/string

2011-07-21 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul 21 20:06:14 2011
New Revision: 224253
URL: http://svn.freebsd.org/changeset/base/224253

Log:
  Remove incorrect attribution.
  
  Approved by:  re (kib)
  Pointed out by: brueffer
  Pointy hat to: gnn

Modified:
  head/lib/libc/amd64/string/stpcpy.S

Modified: head/lib/libc/amd64/string/stpcpy.S
==
--- head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 20:02:22 2011
(r224252)
+++ head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 20:06:14 2011
(r224253)
@@ -1,5 +1,5 @@
 /*
- * Adapted by Guillaume Morin  from strcpy.S
+ * Adapted by Guillaume Morin  from strcpy.S
  * written by J.T. Conklin 
  * Public domain.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224254 - head/sys/dev/acpica

2011-07-21 Thread John Baldwin
Author: jhb
Date: Thu Jul 21 20:43:43 2011
New Revision: 224254
URL: http://svn.freebsd.org/changeset/base/224254

Log:
  Allow non-fixed endpoints for a producer address range if the length of
  the resource covers the entire range.  Some BIOSes appear to mark
  endpoints as non-fixed incorrectly (non-fixed endpoints are supposed to
  be used in _PRS when OSPM is allowed to allocate a certain chunk of
  address space within a larger range, I don't believe it is supposed to be
  used for _CRS).
  
  Approved by:  re (kib)

Modified:
  head/sys/dev/acpica/acpi_pcib_acpi.c

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==
--- head/sys/dev/acpica/acpi_pcib_acpi.cThu Jul 21 20:06:14 2011
(r224253)
+++ head/sys/dev/acpica/acpi_pcib_acpi.cThu Jul 21 20:43:43 2011
(r224254)
@@ -207,9 +207,11 @@ acpi_pcib_producer_handler(ACPI_RESOURCE
length = res->Data.ExtAddress64.AddressLength;
break;
}
-   if (length == 0 ||
-   res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED ||
-   res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED)
+   if (length == 0)
+   break;
+   if (min + length - 1 != max &&
+   (res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED ||
+   res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED))
break;
flags = 0;
switch (res->Data.Address.ResourceType) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r224255 - head/sys/sys

2011-07-21 Thread Jonathan Anderson
Author: jonathan
Date: Thu Jul 21 21:08:33 2011
New Revision: 224255
URL: http://svn.freebsd.org/changeset/base/224255

Log:
  Declare more capability method rights.
  
  This is a complete set of rights that can be held in a capability's
  rights mask.
  
  Approved by: re (kib), mentor (rwatson)
  Sponsored by: Google Inc

Modified:
  head/sys/sys/capability.h

Modified: head/sys/sys/capability.h
==
--- head/sys/sys/capability.h   Thu Jul 21 20:43:43 2011(r224254)
+++ head/sys/sys/capability.h   Thu Jul 21 21:08:33 2011(r224255)
@@ -53,11 +53,78 @@
  * mmap() and aio*() system calls will need special attention as they may
  * involve reads or writes depending a great deal on context.
  */
+
+/* General file I/O. */
 #defineCAP_READ0x0001ULL   /* read/recv */
 #defineCAP_WRITE   0x0002ULL   /* write/send */
 #defineCAP_MMAP0x0004ULL   /* mmap */
 #defineCAP_MAPEXEC 0x0008ULL   /* mmap(2) as 
exec */
-#defineCAP_MASK_VALID  0x000fULL
+#defineCAP_FEXECVE 0x0010ULL
+#defineCAP_FSYNC   0x0020ULL
+#defineCAP_FTRUNCATE   0x0040ULL
+#defineCAP_SEEK0x0080ULL
+
+/* VFS methods. */
+#defineCAP_FCHFLAGS0x0100ULL
+#defineCAP_FCHDIR  0x0200ULL
+#defineCAP_FCHMOD  0x0400ULL
+#defineCAP_FCHOWN  0x0800ULL
+#defineCAP_FCNTL   0x1000ULL
+#defineCAP_FPATHCONF   0x2000ULL
+#defineCAP_FLOCK   0x4000ULL
+#defineCAP_FSCK0x8000ULL
+#defineCAP_FSTAT   0x0001ULL
+#defineCAP_FSTATFS 0x0002ULL
+#defineCAP_FUTIMES 0x0004ULL
+
+/* Extended attributes. */
+#defineCAP_EXTATTR_DELETE  0x0008ULL
+#defineCAP_EXTATTR_GET 0x0010ULL
+#defineCAP_EXTATTR_LIST0x0020ULL
+#defineCAP_EXTATTR_SET 0x0040ULL
+
+/* Access Control Lists. */
+#defineCAP_ACL_CHECK   0x0080ULL
+#defineCAP_ACL_DELETE  0x0100ULL
+#defineCAP_ACL_GET 0x0200ULL
+#defineCAP_ACL_SET 0x0400ULL
+
+/* Socket operations. */
+#defineCAP_ACCEPT  0x0800ULL
+#defineCAP_BIND0x1000ULL
+#defineCAP_CONNECT 0x2000ULL
+#defineCAP_GETPEERNAME 0x4000ULL
+#defineCAP_GETSOCKNAME 0x8000ULL
+#defineCAP_GETSOCKOPT  0x0001ULL
+#defineCAP_LISTEN  0x0002ULL
+#defineCAP_PEELOFF 0x0004ULL
+#defineCAP_SETSOCKOPT  0x0008ULL
+#defineCAP_SHUTDOWN0x0010ULL
+
+#defineCAP_SOCK_ALL \
+   (CAP_ACCEPT | CAP_BIND | CAP_CONNECT \
+| CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT \
+| CAP_LISTEN | CAP_PEELOFF | CAP_SETSOCKOPT | CAP_SHUTDOWN)
+
+/* Mandatory Access Control. */
+#defineCAP_MAC_GET 0x0020ULL
+#defineCAP_MAC_SET 0x0040ULL
+
+/* Methods on semaphores. */
+#defineCAP_SEM_GETVALUE0x0080ULL
+#defineCAP_SEM_POST0x0100ULL
+#defineCAP_SEM_WAIT0x0200ULL
+
+/* Events - maybe we need a post/get distinction? */
+#defineCAP_EVENT   0x0400ULL
+#defineCAP_KEVENT  0x0800ULL
+
+/* Strange and powerful rights that should not be given lightly. */
+#defineCAP_IOCTL   0x1000ULL
+#defineCAP_TTYHOOK 0x2000ULL
+
+/* The mask of all valid method rights. */
+#defineCAP_MASK_VALID  0x3fffULL
 
 #ifdef _KERNEL
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"