ichsmb_var.h revision 139749
1139749Simp/*- 266703Sarchie * ichsmb_var.h 366703Sarchie * 466703Sarchie * Copyright (c) 2000 Whistle Communications, Inc. 566703Sarchie * All rights reserved. 666703Sarchie * 766703Sarchie * Subject to the following obligations and disclaimer of warranty, use and 866703Sarchie * redistribution of this software, in source or object code forms, with or 966703Sarchie * without modifications are expressly permitted by Whistle Communications; 1066703Sarchie * provided, however, that: 1166703Sarchie * 1. Any and all reproductions of the source or object code must include the 1266703Sarchie * copyright notice above and the following disclaimer of warranties; and 1366703Sarchie * 2. No rights are granted, in any manner or form, to use Whistle 1466703Sarchie * Communications, Inc. trademarks, including the mark "WHISTLE 1566703Sarchie * COMMUNICATIONS" on advertising, endorsements, or otherwise except as 1666703Sarchie * such appears in the above copyright notice or in the software. 1766703Sarchie * 1866703Sarchie * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND 1966703Sarchie * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO 2066703Sarchie * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, 2166703Sarchie * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF 2266703Sarchie * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 2366703Sarchie * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY 2466703Sarchie * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS 2566703Sarchie * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. 2666703Sarchie * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES 2766703Sarchie * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING 2866703Sarchie * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 2966703Sarchie * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR 3066703Sarchie * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY 3166703Sarchie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3266703Sarchie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3366703Sarchie * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 3466703Sarchie * OF SUCH DAMAGE. 3566703Sarchie * 3666703Sarchie * Author: Archie Cobbs <archie@freebsd.org> 3766703Sarchie * 3866703Sarchie * $FreeBSD: head/sys/dev/ichsmb/ichsmb_var.h 139749 2005-01-06 01:43:34Z imp $ 3966703Sarchie */ 4066703Sarchie 4166703Sarchie#ifndef _DEV_ICHSMB_ICHSMB_VAR_H 4266703Sarchie#define _DEV_ICHSMB_ICHSMB_VAR_H 4366703Sarchie 4466703Sarchie#include "smbus_if.h" 4566703Sarchie 4666703Sarchie/* Per-device private info */ 4766703Sarchiestruct ichsmb_softc { 4866703Sarchie 4966703Sarchie /* Device/bus stuff */ 5066703Sarchie device_t dev; /* this device */ 5166703Sarchie struct resource *io_res; /* i/o port resource */ 5266703Sarchie int io_rid; /* i/o port bus id */ 5366703Sarchie bus_space_tag_t io_bst; /* bus space tag */ 5466703Sarchie bus_space_handle_t io_bsh; /* bus space handle */ 5566703Sarchie struct resource *irq_res; /* interrupt resource */ 5666703Sarchie int irq_rid; /* interrupt bus id */ 5766703Sarchie void *irq_handle; /* handle for interrupt code */ 5866703Sarchie 5966703Sarchie /* Device state */ 6066703Sarchie int ich_cmd; /* ich command, or -1 */ 6166703Sarchie int smb_error; /* result of smb command */ 6266703Sarchie int block_count; /* count for block read/write */ 6366703Sarchie int block_index; /* index for block read/write */ 6466703Sarchie u_char block_write; /* 0=read, 1=write */ 6566703Sarchie u_char block_data[32]; /* block read/write data */ 6669689Sarchie struct mtx mutex; /* device mutex */ 6766703Sarchie}; 6866703Sarchietypedef struct ichsmb_softc *sc_p; 6966703Sarchie 7066703Sarchie/* SMBus methods */ 7166703Sarchieextern smbus_callback_t ichsmb_callback; 7266703Sarchieextern smbus_quick_t ichsmb_quick; 7366703Sarchieextern smbus_sendb_t ichsmb_sendb; 7466703Sarchieextern smbus_recvb_t ichsmb_recvb; 7566703Sarchieextern smbus_writeb_t ichsmb_writeb; 7666703Sarchieextern smbus_writew_t ichsmb_writew; 7766703Sarchieextern smbus_readb_t ichsmb_readb; 7866703Sarchieextern smbus_readw_t ichsmb_readw; 7966703Sarchieextern smbus_pcall_t ichsmb_pcall; 8066703Sarchieextern smbus_bwrite_t ichsmb_bwrite; 8166703Sarchieextern smbus_bread_t ichsmb_bread; 8266703Sarchie 8366703Sarchie/* Other functions */ 8466703Sarchieextern void ichsmb_device_intr(void *cookie); 8566703Sarchieextern void ichsmb_release_resources(sc_p sc); 8666703Sarchieextern int ichsmb_probe(device_t dev); 8766703Sarchieextern int ichsmb_attach(device_t dev); 8866703Sarchie 8966703Sarchie#endif /* _DEV_ICHSMB_ICHSMB_VAR_H */ 9066703Sarchie 91