兼職工作,全職收入,每月增加2-5萬

2010-06-20 Thread bre...@yahoo.com
From: bre...@yahoo.com

Subject: eh7e7%d=,e(h7f6e%,f/fee
 2-5h,

-This page was sent to you by:  bre...@yahoo.com-
Message from sender:
pfont size=5a rel=nofollow target=_blank 
href=http://www.moonnini.com/w/herblifetw/;f(f/fefif/f/fd8
f;?f?brf(e72e-ee
g6d8f g  ?brf(d8
f3d8g-eeh6he;f%e0e-)ggf4;?brg+e
3e
 e%WFSe(e.6e7%d=g3;g51brWFSf/g6ig'e-8h(-h(,brg,egd;#e
f*dge7%d=f(!ebre*hh7hfed8h57bri2e%ieg3;g51f
i(e01g-brf(e0f9h.
g.e
ggf4; e/gh*e71ge$f3brbre?+fih#!f9h.
f(ggf4;(ie94f;?23f-2)/a/font/p

***

eh7e7%d=,e(h7f6e%,f/fee
 2-5h,
(http://add.my.yahoo.com)

***

Find related stories here
Yahoo! Yearinreview (http://yearinreview.yahoo.com)

---
Please remember that your use of Yahoo! products and services is subject to 
Yahoo! Terms of Service



Re: Add support to AR5424

2010-06-20 Thread Luis Henriques
Hi,

I'm attaching a patch I've been using for a couple of weeks now.  Can
anyone give it a try?  As usual, no guarantees -- it may crash your
system, so be careful.

Just let me know of any successful/unsuccessful story.

--
Luis Henriques
Index: dev/ic/ar5212.c
===
RCS file: /home/miguel/openbsd-cvsroot//src/sys/dev/ic/ar5212.c,v
retrieving revision 1.51
diff -u -p -r1.51 ar5212.c
--- dev/ic/ar5212.c 2 Jun 2009 12:39:02 -   1.51
+++ dev/ic/ar5212.c 23 May 2010 18:33:01 -
@@ -30,6 +30,7 @@ HAL_BOOL   ar5k_ar5212_nic_wakeup(struct 
 u_int16_t   ar5k_ar5212_radio_revision(struct ath_hal *, HAL_CHIP);
 voidar5k_ar5212_fill(struct ath_hal *);
 HAL_BOOLar5k_ar5212_txpower(struct ath_hal *, HAL_CHANNEL *, u_int);
+voidar5k_ar5212_hw_set_sleep_clock(struct ath_hal *, HAL_BOOL);
 
 /*
  * Initial register setting for the AR5212
@@ -234,9 +235,17 @@ ar5k_ar5212_attach(u_int16_t device, voi
hal-ah_phy_spending = AR5K_AR5212_PHY_SPENDING_AR5424;
hal-ah_radio_5ghz_revision = hal-ah_radio_2ghz_revision =
AR5K_SREV_VER_AR5413;
-   } else if (srev == AR5K_SREV_VER_AR2425) {
+   } else if (hal-ah_mac_version == (AR5K_SREV_VER_AR2425  4) ||
+   hal-ah_mac_version == (AR5K_SREV_VER_AR2417  4) ||
+   hal-ah_phy_revision == (AR5K_SREV_PHY_2425)) {
hal-ah_radio = AR5K_AR2425;
-   hal-ah_phy_spending = AR5K_AR5212_PHY_SPENDING_AR5112;
+   hal-ah_single_chip = AH_TRUE;
+   hal-ah_radio_5ghz_revision= AR5K_SREV_RAD_2425;
+   } else if ((hal-ah_mac_version == (AR5K_SREV_VER_AR2424  4)) ||
+   (hal-ah_phy_revision == AR5K_SREV_PHY_5413)) {
+   hal-ah_radio = AR5K_AR5413;
+   hal-ah_single_chip = AH_TRUE;
+   hal-ah_radio_5ghz_revision = AR5K_SREV_RAD_5413;
} else if (hal-ah_radio_5ghz_revision  AR5K_SREV_RAD_5112) {
hal-ah_radio = AR5K_AR5111;
hal-ah_phy_spending = AR5K_AR5212_PHY_SPENDING_AR5111;
@@ -262,6 +271,12 @@ ar5k_ar5212_attach(u_int16_t device, voi
}
hal-ah_phy = AR5K_AR5212_PHY(0);
 
+   /* Enable pci core retry fix on Hainan (5213A) and later chips */
+   if (srev = AR5K_SREV_VER_AR5213A) {
+   AR5K_REG_ENABLE_BITS(AR5K_AR5212_PCICFG,
+   AR5K_AR5212_PCICFG_RETRY_FIX);
+   }
+
if (hal-ah_pci_express == AH_TRUE) {
/* PCI-Express based devices need some extra initialization */
ar5k_write_ini(hal, ar5212_pcie, nitems(ar5212_pcie), 0);
@@ -312,7 +327,7 @@ ar5k_ar5212_nic_reset(struct ath_hal *ha
 HAL_BOOL
 ar5k_ar5212_nic_wakeup(struct ath_hal *hal, u_int16_t flags)
 {
-   u_int32_t turbo, mode, clock;
+   u_int32_t turbo, mode, clock, bus_flags;
 
turbo = 0;
mode = 0;
@@ -335,7 +350,10 @@ ar5k_ar5212_nic_wakeup(struct ath_hal *h
clock |= AR5K_AR5212_PHY_PLL_44MHZ;
} else if (flags  IEEE80211_CHAN_5GHZ) {
mode |= AR5K_AR5212_PHY_MODE_FREQ_5GHZ;
-   clock |= AR5K_AR5212_PHY_PLL_40MHZ;
+   if (hal-ah_radio == AR5K_AR5413)
+   clock |= AR5K_AR5212_PHY_PLL_40MHZ_5413;
+   else
+   clock |= AR5K_AR5212_PHY_PLL_40MHZ;
} else {
AR5K_PRINT(invalid radio frequency mode\n);
return (AH_FALSE);
@@ -361,23 +379,30 @@ ar5k_ar5212_nic_wakeup(struct ath_hal *h
 * Reset and wakeup the device
 */
 
-   /* ...reset chipset and PCI device (if not PCI-E) */
-   if (hal-ah_pci_express == AH_FALSE 
-   ar5k_ar5212_nic_reset(hal, AR5K_AR5212_RC_CHIP) == AH_FALSE) {
-   AR5K_PRINT(failed to reset the AR5212 + PCI chipset\n);
+   /* Wakeup the device */
+   if (ar5k_ar5212_set_power(hal,
+   HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
+   AR5K_PRINT(failed to wakeup the AR5212 chipset\n);
+   return (AH_FALSE);
+   }
+
+   /* ...reset chipset and PCI device */
+   bus_flags = (hal-ah_pci_express != AH_FALSE) ? 0 : AR5K_AR5212_RC_PCI;
+   if (ar5k_ar5212_nic_reset(hal, bus_flags) == AH_FALSE) {
+   AR5K_PRINT(failed to reset the AR5212 chipset\n);
return (AH_FALSE);
}
 
-   /* ...wakeup */
+   /* ...wakeup again */
if (ar5k_ar5212_set_power(hal,
HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
-   AR5K_PRINT(failed to resume the AR5212 (again)\n);
+   AR5K_PRINT(failed to wakeup (again) the AR5212 chipset\n);
return (AH_FALSE);
}
 
/* ...final warm reset */
if (ar5k_ar5212_nic_reset(hal, 0) == AH_FALSE) {
-   AR5K_PRINT(failed to warm reset the AR5212\n);
+   AR5K_PRINT(failed to 

Re: Add support to AR5424

2010-06-20 Thread Adam M. Dutko
Full patch against latest I assume b/c of the 1.51 version tag of ar5212.c.
I'll need to update before I test, but I'll try to test soon.  Thanks.



PF state inspection, second try

2010-06-20 Thread Vadim Jukov
Hello tech@ and PF hackers especially, again.

Here is my second, more advanced try on implementing packet inspection in
PF. This time it can inspect and drop established connection. I used one
of the pad bytes in pf_state structure for this; hope this is harmless.

Also, there are many fixes mentioned for previous version, especially from
Bret Lambert (thanks again!). Hope I got panic logic right this time.

Non-obvious interventions has comments in the code (and, therefore, in
the patch).

The feature I thought about but did not implemented is inspecting _every_
packet in the state. If anyone will vote for it, I'll implement it, it's
rather easy now, but the diff is already long enough (almost 800 lines).

And the last I can say: It Works For Me (TM).

-- 
  Best wishes,
Vadim Zhukov


Index: share/man/man5/pf.conf.5
===
RCS file: /cvs/src/share/man/man5/pf.conf.5,v
retrieving revision 1.476
diff -u -r1.476 pf.conf.5
--- share/man/man5/pf.conf.519 May 2010 13:51:37 -  1.476
+++ share/man/man5/pf.conf.520 Jun 2010 22:50:06 -
@@ -546,6 +546,62 @@
 .Pc
 must match.
 .Pp
+.It Xo
+.Ar inspect Aq Ar value
+.Aq Ar op
+.Aq Ar mask
+.Aq Ar direction
+.Ar in Aq Ar pktnum
+.Ar at Aq Ar offset
+.Xc
+Tests contents of
+.Ar pktnum
+packet flowing in
+.Ar direction
+at the
+.Ar offset
+to be equal to
+.Ar value ,
+optionally applying
+.Ar mask
+operation
+.Ar op .
+Packets are numbered starting from 1, which is default.
+Packets numbers larger than 1 are meaningful only in stateful rules, and
+therefore are rejected on stateless ones.
+.Pp
+Offset starts after protocol header, numbering from 0, which is default.
+Negative offset cannot be specified.
+.Pp
+.Ar direction
+can be one of the following:
+.Bl -tag -width both_directions
+.It Ar incoming
+Only incoming packets are accounted and inspected.
+This is the default.
+.It Ar outgoing
+Only outgoung packets are accounted and inspected.
+.It Ar both directions
+Packets flowing in both directions are taken in account.
+Inspection happens once:
+.Ar pktnum
+is compared with sum of numbers of packets in and out.
+.El
+.Pp
+.Ar value
+and
+.Ar mask
+can be specified as plain strings, or as hexadecimal raw strings (i.e.,
+starting with 0x).
+In the latter case you can embed any special characters.
+Maximum length of encoded either way data is 64 bytes.
+.Pp
+Two mask operations supported are logical and and logical exclusive or.
+They're specified using  and ^ characters, respectively.
+If no mask operation specified then packet contents is compared with
+.Ar value
+as is.
+.Pp
 .It Ar label Aq Ar string
 Adds a label to the rule, which can be used to identify the rule.
 For instance,
@@ -2643,7 +2699,8 @@
 nat-to ( redirhost | { redirhost-list } )
 [ portspec ] [ pooltype ] [ static-port ] |
 [ fastroute | route ] |
-[ received-on ( interface-name | interface-group ) ]
+[ received-on ( interface-name | interface-group ) ] |
+inspect inspect
 
 scrubopts  = scrubopt [ [ , ] scrubopts ]
 scrubopt   = no-df | min-ttl number | max-mss number |
@@ -2786,6 +2843,10 @@
 upperlimit-sc  = upperlimit sc-spec
 sc-spec= ( bandwidth-spec |
  ( bandwidth-spec number bandwidth-spec ) )
+inspect= string [ inspect-op ] [ inspect-dir ] [ in number ]
+ [ at number ]
+inspect-op = (  | ^ ) string
+inspect-dir= ( incoming | outgoing | both directions )
 include= include filename
 .Ed
 .Sh FILES
Index: sys/net/pf.c
===
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.691
diff -u -r1.691 pf.c
--- sys/net/pf.c7 May 2010 13:33:16 -   1.691
+++ sys/net/pf.c20 Jun 2010 22:50:06 -
@@ -230,6 +230,10 @@
struct pf_state_key_cmp *, u_int, struct mbuf *);
 int pf_src_connlimit(struct pf_state **);
 int pf_check_congestion(struct ifqueue *);
+int pf_inspect(struct pf_pdesc *, struct mbuf *,
+   struct pf_rule *);
+static __inline int pf_inspect_state(struct pf_pdesc *, struct mbuf *,
+   struct pf_state *, struct pfi_kif *);
 int pf_match_rcvif(struct mbuf *, struct pf_rule *);
 
 extern struct pool pfr_ktable_pl;
@@ -246,11 +250,14 @@
 enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK };
 
 
-#define STATE_LOOKUP(i, k, d, s, m)\
+#define STATE_LOOKUP(i, k, d, s, m, pd)
\
do {\
s = pf_find_state(i, k, d, m);  \
if (s == NULL || (s)-timeout == PFTM_PURGE)\