1 /* Driver for Realtek RTS51xx USB card reader 2 * 3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License as published by the 7 * Free Software Foundation; either version 2, or (at your option) any 8 * later version. 9 * 10 * This program is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, see <http://www.gnu.org/licenses/>. 17 * 18 * Author: 19 * wwang (wei_wang@realsil.com.cn) 20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China 21 * Maintainer: 22 * Edwin Rong (edwin_rong@realsil.com.cn) 23 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China 24 */ 25 26 #ifndef __RTS51X_FOP_H 27 #define __RTS51X_FOP_H 28 29 #include "rts51x.h" 30 31 #ifdef SUPPORT_FILE_OP 32 33 #include <linux/fs.h> 34 #include <linux/types.h> 35 36 struct sd_direct_cmnd { 37 u8 cmnd[12]; 38 void *buf; 39 int buf_len; 40 }; 41 42 struct sd_rsp { 43 void *rsp; 44 int rsp_len; 45 }; 46 47 int rts51x_open(struct inode *inode, struct file *filp); 48 int rts51x_release(struct inode *inode, struct file *filp); 49 ssize_t rts51x_read(struct file *filp, char __user *buf, size_t count, 50 loff_t *f_pos); 51 ssize_t rts51x_write(struct file *filp, const char __user *buf, size_t count, 52 loff_t *f_pos); 53 #if 0 /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) */ 54 int rts51x_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 55 unsigned long arg); 56 #else 57 long rts51x_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 58 #endif 59 60 #endif 61 62 #endif /* __RTS51X_FOP_H */ 63