1/* 2 * Copyright 2008, Fran��ois Revol, <revol@free.fr>. 3 * Copyright 2007-2008, Ingo Weinhold, bonefish@cs.tu-berlin.de. 4 * Copyright 2004-2006, Axel D��rfler, axeld@pinc-software.de. All rights reserved. 5 * Distributed under the terms of the MIT License. 6 */ 7 8 9#include <ctype.h> 10#include <errno.h> 11#include <signal.h> 12#include <stdio.h> 13#include <string.h> 14#include <sys/stat.h> 15#include <unistd.h> 16 17#include <util/AutoLock.h> 18#include <util/kernel_cpp.h> 19 20#include <team.h> 21 22#include <tty.h> 23 24#include <KernelExport.h> 25#include <device_manager.h> 26#include <bus_manager.h> 27#include <tty/ttylayer.h> 28 29#include "tty_private.h" 30 31//#define TTY_TRACE 32#ifdef TTY_TRACE 33# define TRACE(x) dprintf x 34#else 35# define TRACE(x) ; 36#endif 37 38 39 40 41status_t 42tty_open(struct ttyfile *, struct ddrover *, tty_service_func) 43{ 44 return B_OK; 45} 46 47 48status_t 49tty_close(struct ttyfile *, struct ddrover *) 50{ 51 return B_OK; 52} 53 54 55status_t 56tty_free(struct ttyfile *, struct ddrover *) 57{ 58 return B_OK; 59} 60 61 62status_t 63tty_read(struct ttyfile *, struct ddrover *, char *, size_t *) 64{ 65 return B_OK; 66} 67 68 69status_t 70tty_write(struct ttyfile *, struct ddrover *, const char *, size_t *) 71{ 72 return B_OK; 73} 74 75 76status_t 77tty_control(struct ttyfile *, struct ddrover *, ulong, void *, size_t) 78{ 79 return B_OK; 80} 81 82 83status_t 84tty_select(struct ttyfile *, struct ddrover *, uint8, uint32, selectsync *) 85{ 86 return B_OK; 87} 88 89 90status_t 91tty_deselect(struct ttyfile *, struct ddrover *, uint8, selectsync *) 92{ 93 return B_OK; 94} 95 96 97void 98tty_init(struct tty *, bool) 99{ 100} 101 102 103void 104tty_ilock(struct tty *, struct ddrover *, bool ) 105{ 106} 107 108 109void 110tty_hwsignal(struct tty *, struct ddrover *, int, bool) 111{ 112} 113 114 115int 116tty_in(struct tty *, struct ddrover *, int) 117{ 118 return 0; 119} 120 121 122int 123tty_out(struct tty *, struct ddrover *) 124{ 125 return 0; 126} 127 128 129// #pragma mark ddrover handling 130 131 132struct ddrover * 133tty_dd_rstart(struct ddrover *) 134{ 135 return NULL; 136} 137 138 139void 140tty_dd_rdone(struct ddrover *) 141{ 142} 143 144void 145tty_dd_acquire(struct ddrover *, struct ddomain *) 146{ 147} 148 149 150// #pragma mark bus manager exports 151 152 153status_t 154tty_module_init(void) 155{ 156 return B_OK; 157} 158 159 160void 161tty_module_uninit(void) 162{ 163} 164 165 166static int32 167tty_module_std_ops(int32 op, ...) 168{ 169 switch (op) { 170 case B_MODULE_INIT: 171 { 172 status_t status; 173 174 //TRACE(("TTY: tty_module_init\n")); 175 176 status = tty_module_init(); 177 if (status < B_OK) 178 return status; 179 180 return B_OK; 181 } 182 183 case B_MODULE_UNINIT: 184 //TRACE(("TTY: tty_module_uninit\n")); 185 tty_module_uninit(); 186 return B_OK; 187 } 188 189 return B_BAD_VALUE; 190} 191 192 193static struct tty_module_info_r5 sR5TTYModule = { 194 // ! this is *NOT* a real bus manager (no rescan call!) 195 //{ 196 { 197 B_TTY_MODULE_NAME, 198 0, //B_KEEP_LOADED, 199 tty_module_std_ops 200 }, 201 //NULL 202 //}, 203 &tty_open, 204 &tty_close, 205 &tty_free, 206 &tty_read, 207 &tty_write, 208 &tty_control, 209 &tty_init, 210 &tty_ilock, 211 &tty_hwsignal, 212 &tty_in, 213 &tty_out, 214 &tty_dd_rstart, 215 &tty_dd_rdone, 216 &tty_dd_acquire 217}; 218 219static struct tty_module_info_dano sDanoTTYModule = { 220 // ! this is *NOT* a real bus manager (no rescan call!) 221 //{ 222 { 223 B_TTY_MODULE_NAME_DANO, 224 0, //B_KEEP_LOADED, 225 tty_module_std_ops 226 }, 227 //NULL 228 //}, 229 &tty_open, 230 &tty_close, 231 &tty_free, 232 &tty_read, 233 &tty_write, 234 &tty_control, 235 &tty_select, 236 &tty_deselect, 237 &tty_init, 238 &tty_ilock, 239 &tty_hwsignal, 240 &tty_in, 241 &tty_out, 242 &tty_dd_rstart, 243 &tty_dd_rdone, 244 &tty_dd_acquire 245}; 246 247module_info *modules[] = { 248 (module_info *)&sR5TTYModule, 249 (module_info *)&sDanoTTYModule, 250 NULL 251}; 252