1239310Sdim/*- 2239310Sdim * Copyright (c) 1998 Nicolas Souchu 3239310Sdim * All rights reserved. 4239310Sdim * 5239310Sdim * Redistribution and use in source and binary forms, with or without 6239310Sdim * modification, are permitted provided that the following conditions 7239310Sdim * are met: 8239310Sdim * 1. Redistributions of source code must retain the above copyright 9239310Sdim * notice, this list of conditions and the following disclaimer. 10239310Sdim * 2. Redistributions in binary form must reproduce the above copyright 11239310Sdim * notice, this list of conditions and the following disclaimer in the 12239310Sdim * documentation and/or other materials provided with the distribution. 13239310Sdim * 14239310Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15239310Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16239310Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17239310Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18239310Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19239310Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20239310Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21239310Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22239310Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23239310Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24239310Sdim * SUCH DAMAGE. 25239310Sdim * 26243830Sdim * $FreeBSD$ 27243830Sdim * 28239310Sdim */ 29239310Sdim#ifndef __SMB_H 30239310Sdim#define __SMB_H 31239310Sdim 32239310Sdim#include <sys/ioccom.h> 33239310Sdim 34239310Sdimstruct smbcmd { 35239310Sdim char cmd; 36239310Sdim int count; 37239310Sdim u_char slave; 38239310Sdim union { 39239310Sdim char byte; 40239310Sdim short word; 41239310Sdim 42239310Sdim char *byte_ptr; 43239310Sdim short *word_ptr; 44239310Sdim 45239310Sdim struct { 46239310Sdim short sdata; 47239310Sdim short *rdata; 48239310Sdim } process; 49239310Sdim } data; 50239310Sdim}; 51243830Sdim 52243830Sdim/* 53239310Sdim * SMBus spec 2.0 says block transfers may be at most 32 bytes. 54239310Sdim */ 55239310Sdim#define SMB_MAXBLOCKSIZE 32 56243830Sdim 57243830Sdim#define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd) 58239310Sdim#define SMB_QUICK_READ _IOW('i', 2, struct smbcmd) 59239310Sdim#define SMB_SENDB _IOW('i', 3, struct smbcmd) 60239310Sdim#define SMB_RECVB _IOWR('i', 4, struct smbcmd) 61239310Sdim#define SMB_WRITEB _IOW('i', 5, struct smbcmd) 62239310Sdim#define SMB_WRITEW _IOW('i', 6, struct smbcmd) 63239310Sdim#define SMB_READB _IOW('i', 7, struct smbcmd) 64239310Sdim#define SMB_READW _IOW('i', 8, struct smbcmd) 65239310Sdim#define SMB_PCALL _IOW('i', 9, struct smbcmd) 66239310Sdim#define SMB_BWRITE _IOW('i', 10, struct smbcmd) 67239310Sdim#define SMB_OLD_BREAD _IOW('i', 11, struct smbcmd) 68239310Sdim#define SMB_BREAD _IOWR('i', 11, struct smbcmd) 69239310Sdim 70239310Sdim#endif 71239310Sdim