138780Snsouch/*- 238780Snsouch * Copyright (c) 1998 Nicolas Souchu 338780Snsouch * All rights reserved. 438780Snsouch * 538780Snsouch * Redistribution and use in source and binary forms, with or without 638780Snsouch * modification, are permitted provided that the following conditions 738780Snsouch * are met: 838780Snsouch * 1. Redistributions of source code must retain the above copyright 938780Snsouch * notice, this list of conditions and the following disclaimer. 1038780Snsouch * 2. Redistributions in binary form must reproduce the above copyright 1138780Snsouch * notice, this list of conditions and the following disclaimer in the 1238780Snsouch * documentation and/or other materials provided with the distribution. 1338780Snsouch * 1438780Snsouch * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1538780Snsouch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1638780Snsouch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1738780Snsouch * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1838780Snsouch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1938780Snsouch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2038780Snsouch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2138780Snsouch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2238780Snsouch * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2338780Snsouch * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2438780Snsouch * SUCH DAMAGE. 2538780Snsouch * 2650477Speter * $FreeBSD$ 2738780Snsouch * 2838780Snsouch */ 2938780Snsouch#ifndef __SMB_H 3038780Snsouch#define __SMB_H 3138780Snsouch 3238780Snsouch#include <sys/ioccom.h> 3338780Snsouch 3438780Snsouchstruct smbcmd { 3538780Snsouch char cmd; 3638780Snsouch int count; 3742442Snsouch u_char slave; 3838780Snsouch union { 3938780Snsouch char byte; 4038780Snsouch short word; 4138780Snsouch 4238780Snsouch char *byte_ptr; 4338780Snsouch short *word_ptr; 4438780Snsouch 4538780Snsouch struct { 4638780Snsouch short sdata; 4738780Snsouch short *rdata; 4838780Snsouch } process; 4938780Snsouch } data; 5038780Snsouch}; 5138780Snsouch 52129290Sjoerg/* 53129290Sjoerg * SMBus spec 2.0 says block transfers may be at most 32 bytes. 54129290Sjoerg */ 55129290Sjoerg#define SMB_MAXBLOCKSIZE 32 56129290Sjoerg 5742442Snsouch#define SMB_QUICK_WRITE _IOW('i', 1, struct smbcmd) 5842442Snsouch#define SMB_QUICK_READ _IOW('i', 2, struct smbcmd) 5938780Snsouch#define SMB_SENDB _IOW('i', 3, struct smbcmd) 60129290Sjoerg#define SMB_RECVB _IOWR('i', 4, struct smbcmd) 6138780Snsouch#define SMB_WRITEB _IOW('i', 5, struct smbcmd) 6238780Snsouch#define SMB_WRITEW _IOW('i', 6, struct smbcmd) 6338780Snsouch#define SMB_READB _IOW('i', 7, struct smbcmd) 6438780Snsouch#define SMB_READW _IOW('i', 8, struct smbcmd) 6538780Snsouch#define SMB_PCALL _IOW('i', 9, struct smbcmd) 6638780Snsouch#define SMB_BWRITE _IOW('i', 10, struct smbcmd) 67162234Sjhb#define SMB_OLD_BREAD _IOW('i', 11, struct smbcmd) 68162234Sjhb#define SMB_BREAD _IOWR('i', 11, struct smbcmd) 6938780Snsouch 7038780Snsouch#endif 71