Commit Graph

22561 Commits

Author SHA1 Message Date
xtraeme 9622f8ee94 s/ENVSYS_FMONDRVSTATE/ENVSYS_FMONSTCHANGED/. Noticed by Manuel Bouyer@. 2007-09-04 20:46:00 +00:00
xtraeme debeab5278 - Use a ENVSYS_BATTERY_STATE sensor rather than ENVSYS_GSTRING.
- Use ENVSYS_FMONSTCHANGED on the ENVSYS_BATTERY_STATE sensor to monitor
  state changes.
2007-09-04 16:56:30 +00:00
xtraeme 5b53183e98 - Remove ENVSYS_GSTRING and the genstr member from envsys_data_t.
(at least three or four persons were against it).
- Add a new sensor type: ENVSYS_BATTERY_STATE, this uses value_cur
  and some predefined values in a static table, like ENVSYS_DRIVE.
- Move all static tables to sysmon_envsys_tables.c and use a function
  on it to retrieve a pointer to the struct of the specified type.
- Rename the ENVSYS_FMONDRVSTCHANGED to ENVSYS_FMONSTCHANGED and make
  it generic for Battery state and drive sensors (this flag enables
  monitoring on these sensors when state has been changed).
- Update sysmon_penvsys_event() to report state changes on
  ENVSYS_BATTERY_STATE sensors and remove other type of events, with
  PENVSYS_EVENT_STATE_CHANGED they are not necessary anymore.
2007-09-04 16:54:02 +00:00
tshiozak d0a32c7b25 add support for WinChipHead CH341/340 USB-Serial bridge. 2007-09-03 17:57:36 +00:00
tshiozak ad88e4382b sync with the last change of usbdevs. 2007-09-03 17:43:20 +00:00
tshiozak 64af3fdf23 add vendor WINCHIPHEAD and product CH341SER. 2007-09-03 17:41:41 +00:00
kiyohara bfdbbbaec2 No need to check the NULL, m_gethdr() was called always with M_WAIT. 2007-09-03 12:42:50 +00:00
kiyohara 6410e0f367 No need to check the NULL, m_gethdr() calls always with M_WAIT. 2007-09-03 12:38:27 +00:00
he 97bd63dbfb Rename function argument from command to cmd, to make the code
actually build after the previous change.
2007-09-03 11:32:07 +00:00
macallan b988fb3a70 back out the reference divider probing - doesn't work right on R1xx 2007-09-03 02:45:06 +00:00
xtraeme dee3b63c54 Add some KASSERT(mutex_owned(&foo_lock)). 2007-09-03 01:29:51 +00:00
riz f6f3fbbfc3 Properly support both ports of the FTDI 2232C. This allows me to
use all 16 ports of my USB-16COM-RM adapter.  I also verified that
single-port units still work as expected.
2007-09-02 22:35:25 +00:00
ober fe1557ca83 regen. added Intel LPC 82801HEM and 82801IO 2007-09-02 21:03:56 +00:00
ober 51d0f6cc38 Add Intel LPC 82801HEM and 82801IO entries 2007-09-02 21:02:52 +00:00
xtraeme cba98bab30 Add a new sensor of type ENVSYS_GSTRING. This is useful to print
the current battery charge state.

$ envstat -dacpibat0 -s"acpibat0 charge state"
  acpibat0 charge state:     NORMAL
$

It will show WARNING, CRITICAL, LOW or NORMAL depending on the
state it is.
2007-09-02 19:38:32 +00:00
xtraeme 1b3709ecde Add a new sensor type to sysmon_envsys(9): ENVSYS_GSTRING.
ENVSYS_GSTRING (aka Generic String) uses the genstr member in
the envsys_data_t struct to add a generic string that envstat(8)
will show as value or state.

It's like the ENVSYS_DRIVER, but doesn't use value_cur. Below
is the dictionary created on these sensors:

<dict>
	<key>description</key>
	<string>acpibat0 charge state</string>
	<key>generic-state-string</key>
	<string>NORMAL</string>
	<key>monitoring-supported</key>
	<false/>
	<key>state</key>
	<string>valid</string>
	<key>type</key>
	<string>Generic string</string>
</dict>

Note that it's limited to 32 chars, but we can grow it if needed.

envstat(8) will print ENVSYS_GSTRING sensors as:

$ envstat -dacpibat0 -s"acpibat0 charge state"
  acpibat0 charge state:     NORMAL
$
2007-09-02 19:36:59 +00:00
macallan 4aee9ec48c always try to probe the reference divider, use default only if that fails 2007-09-02 18:47:27 +00:00
degroote 6471b574ca The service queue isn't used anymore so don't allocate it.
It saves a bit of memory and reduces diff with other BSD.
2007-09-02 12:18:05 +00:00
degroote 58d834d34b Fix scanning code for wpi based on the iwi code.
Keep track of the status of the scan.
On a transition IEEE80211_S_SCAN -> IEEE80211_S_SCAN, don't stop the previous
scan, finish the current scan.
When we receive some frames in the IEEE80211_S_SCAN state, set current_channel
based on the value advertised in beacons or probre reponse.

Moreover, it fixes WPA issues for me.
2007-09-02 11:37:30 +00:00
macallan 01e17775ae don't include machine/autoconf.h - we don't need it (anymore?) 2007-09-02 01:41:29 +00:00
macallan 20316fb57c defflag DEBUG_SGSMIX 2007-09-02 01:40:46 +00:00
xtraeme 0b4713a20a Convert onewire(4) to use rwlock(9) rather than lockmgr(9). 2007-09-02 00:55:33 +00:00
xtraeme e8bf5d91f9 Do not enable monitoring for the sensors... if somebody wants this,
it may be enabled via userland.
2007-09-02 00:54:50 +00:00
xtraeme bed35595ed Attach to the ICH6 AC-97 Modem function. 2007-09-02 00:48:52 +00:00
xtraeme 03b7809379 Add <sys/mutex.h> rather than <sys/lock.h>. 2007-09-02 00:44:07 +00:00
xtraeme c371d1d093 Convert the sysmon watchdog framework to use mutex(9) rather than
simple_locks and initialize them on init_main via sysmon_wdog_init().

All the sysmon code now is cleaned up and doesn't use old style locking.
2007-09-02 00:41:24 +00:00
xtraeme e5db35db44 typo: ENVSYS_FVALID -> ENVSYS_SVALID. 2007-09-02 00:31:23 +00:00
xtraeme fda9e03ae4 Remove unused (and inexistent) flag. 2007-09-02 00:28:28 +00:00
riz a550eae132 For SMBus, add the ability to enumerate devices on the bus.
This does NOT identify the devices, merely indicates the
presence of devices at certain addresses.  Tested on ichsmb
and nfsmb - other SMBus devices will need to ensure the
proper bus type is set. (I2C_TYPE_SMBUS)

From Nicolas Joly, via Paul Goyette, in PR#36744.
2007-09-01 22:19:25 +00:00
ober a9cab94434 *** empty log message *** 2007-09-01 21:47:39 +00:00
ober e18f309a93 ICH8M LPC Interface bridge. ok xtraeme 2007-09-01 21:43:33 +00:00
dyoung 2cb874eb67 Remark that the data-length argument passed to se_scsipi_cmd() is
questionable.
2007-09-01 17:59:45 +00:00
dyoung 0c66a9f0cf Create a temporary, non-const copy of a sockaddr. Pass that to
se_set_multi() or se_remove_multi(), because neither is easily
constified.  Thanks jmmv@ for reporting the issue.
2007-09-01 17:57:02 +00:00
xtraeme e83dd2301e - Fix a memleak in ENVSYS_SETDICTIONARY if there wasn't any error
(thanks god for KMEMSTATS).
- sysmon_envsys_register: add all objects in the dictionary without any
  lock, at this point the sme device hasn't been added into the list
  and it's safe.
- Add sysmon_envsys_destroy_plist(prop_array_t) that destroys all objects
  associated with a device and use it on sysmon_envsys_unregister() and
  sysmon_envsys_register() if there's any error.

Thanks to Mindaugas Rasiukevicius (rmind@) for the great comments/ideas.
2007-09-01 13:43:10 +00:00
xtraeme 9da1b0ba86 sme_event_register: don't forget to add the object in dictionary when
a critical value is added via ENVSYS_SETDICTIONARY.
2007-09-01 12:46:04 +00:00
dyoung c53c02b0c9 Once again, use ether_ioctl() instead of (cmd == SIOCADDMULTI) ?
ether_addmulti() : ether_delmulti().
2007-09-01 07:43:36 +00:00
dyoung dcb45c7c0e Instead of IF_POLL()'ing and IF_DEQUEUE()'ing, just IF_DEQUEUE(). 2007-09-01 07:38:16 +00:00
dyoung 5384cb3ee5 Use bpf_mtap2(). 2007-09-01 07:34:03 +00:00
dyoung dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
dyoung 2fc102750d Use ifreq_setaddr(), ifreq_getaddr(), sockaddr_in_init(), and
sockaddr_copy().  Constify.  Compare pointers with NULL, not 0.
Don't "test truth" of pointers, but compare with NULL.
2007-09-01 04:32:50 +00:00
macallan f9794c16db add screen blanking support 2007-09-01 03:45:14 +00:00
xtraeme 822a96ea64 sme_event_register: sme_sensor_upint32() was being called even when
adding events via sme_event_drvadd(), fix it.
2007-09-01 00:12:07 +00:00
xtraeme 63f1decdb2 - sme_unregister_all: there's no need to use a struct sysmon_envsys as
argument, just pass sme->sme_name to it.
- sysmon_envsys_register: drop the array in all cases, not just when
  there's an error. The reference is stored in the dictionary anyway...
- Update some comments.
2007-08-31 22:44:39 +00:00
xtraeme e71bfccc23 Merge sme_event_add() into sme_event_register()... there's no need
to have two different functions for this.
2007-08-31 10:13:27 +00:00
xtraeme ab98913282 Simplify sme_event_add() and fix a problem when updating critical
values.
2007-08-31 09:12:55 +00:00
xtraeme 097c13a522 Use a different case for the CX700 IDE Controller to print the
attach message and when setting the UDMA mode.
2007-08-31 01:42:48 +00:00
xtraeme ee2b8027ff - Proper VIA CX700 IDE Controller support (missed in previous).
- Attach to the NVIDIA MCP67 IDE and SATA controllers.
2007-08-31 01:37:46 +00:00
xtraeme 930907a507 Proper ICH8M IDE Controller support (missed in previous). 2007-08-31 01:35:07 +00:00
xtraeme 5f6ecf6711 Attach to the VIA CX700 IDE Controller. 2007-08-31 01:22:12 +00:00
xtraeme 6fe677c273 regen 2007-08-31 01:17:39 +00:00