| 1 |
/* |
| 2 |
* Communication functions |
| 3 |
* Copyright (C) 2008 Free Software Foundation, Inc. |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2, or (at your option) |
| 8 |
* any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
* |
| 19 |
* Author: Barry deFreese. |
| 20 |
*/ |
| 21 |
/* |
| 22 |
* Communication functions. |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef _COM_H_ |
| 27 |
#define _COM_H_ |
| 28 |
|
| 29 |
#include <mach/std_types.h> |
| 30 |
#include <device/cons.h> |
| 31 |
#include <device/tty.h> |
| 32 |
#include <chips/busses.h> |
| 33 |
|
| 34 |
/* |
| 35 |
* Set receive modem state from modem status register. |
| 36 |
*/ |
| 37 |
extern void fix_modem_state(int unit, int modem_stat); |
| 38 |
|
| 39 |
extern void comtimer(void * param); |
| 40 |
|
| 41 |
/* |
| 42 |
* Modem change (input signals) |
| 43 |
*/ |
| 44 |
extern void commodem_intr(int unit, int stat); |
| 45 |
|
| 46 |
extern int comgetc(int unit); |
| 47 |
|
| 48 |
extern int comcnprobe(struct consdev *cp); |
| 49 |
extern int comcninit(struct consdev *cp); |
| 50 |
extern int comcngetc(dev_t dev, int wait); |
| 51 |
extern int comcnputc(dev_t dev, int c); |
| 52 |
extern void comintr(int unit); |
| 53 |
|
| 54 |
int comprobe(vm_offset_t port, struct bus_ctlr *dev); |
| 55 |
int commctl(struct tty *tp, int bits, int how); |
| 56 |
void comstart(struct tty *tp); |
| 57 |
void comstop(struct tty *tp, int flags); |
| 58 |
void comattach(struct bus_device *dev); |
| 59 |
|
| 60 |
extern io_return_t |
| 61 |
comgetstat( |
| 62 |
dev_t dev, |
| 63 |
dev_flavor_t flavor, |
| 64 |
dev_status_t data, |
| 65 |
mach_msg_type_number_t *count); |
| 66 |
|
| 67 |
extern io_return_t |
| 68 |
comsetstat( |
| 69 |
dev_t dev, |
| 70 |
dev_flavor_t flavor, |
| 71 |
dev_status_t data, |
| 72 |
mach_msg_type_number_t count); |
| 73 |
|
| 74 |
#if MACH_KDB |
| 75 |
extern void kdb_kintr(void); |
| 76 |
extern void compr_addr(vm_offset_t addr); |
| 77 |
extern int compr(int unit); |
| 78 |
#endif /* MACH_KDB */ |
| 79 |
|
| 80 |
extern io_return_t comopen(dev_t dev, int flag, io_req_t ior); |
| 81 |
extern void comclose(dev_t dev, int flag); |
| 82 |
extern io_return_t comread(dev_t dev, io_req_t ior); |
| 83 |
extern io_return_t comwrite(dev_t dev, io_req_t ior); |
| 84 |
extern io_return_t comportdeath(dev_t dev, mach_port_t port); |
| 85 |
|
| 86 |
#endif /* _COM_H_ */ |