/* * AX.25 usermode device driver. * Copyright (C) 1999-2000 Maxim Krasnyansky * Copyright 2001, by Joerg Reuter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __IF_AX25_UDEV_H #define __IF_AX25_UDEV_H #define AX25_UDEV_VER "0.1" #define AX25_UDEV_DEBUG /* Uncomment to enable debugging */ /* #define AX25_UDEV_DEBUG 1 */ #ifdef __KERNEL__ #ifdef AX25_UDEV_DEBUG #define DBG if(ax25_udev->debug)printk #define DBG1 if(debug==2)printk #else #define DBG( a... ) #define DBG1( a... ) #endif struct ax25_udev_struct { char name[IFNAMSIZ]; unsigned long flags; struct fasync_struct *fasync; wait_queue_head_t read_wait; struct net_device dev; struct sk_buff_head txq; struct net_device_stats stats; struct ax25_dev ax25_dev; struct { int duplex; int arbitration; } capabilities; struct { int dcd:1; int cts:1; int rts:1; int ptt:1; } status; #ifdef AX25_UDEV_DEBUG int debug; #endif }; #endif /* __KERNEL__ */ /* Number of devices */ #define AX25_UDEV_MAX_DEV 255 /* TX queue size */ #define AX25_UDEV_TXQ_SIZE 10 /* Max frame size */ #define AX25_UDEV_MAX_FRAME 4096 /* AX25_UDEV device flags */ #define AX25_UDEV_TYPE_MASK 0x000f #define AX25_UDEV_FASYNC 0x0010 #define AX25_UDEV_IFF_SET 0x1000 /* AX25_UDEV IFF ioctl */ #define AX25_UDEV_SETIFF _IOW(0x25, 0, void *) #define AX25_UDEV_SETDEBUG _IOW(0x25, 1, int) /* Packet layout: * * (int) packet_type * (int) data * ... * * Exception for AX25_UDEV_DATA: * (int) 0 * (char) octet * ... * */ typedef enum ax25_user_dev_commands_e { AX25_UDEV_DATA, AX25_UDEV_CAPABILITIES, AX25_UDEV_DCD_STATUS, AX25_UDEV_CTS_STATUS, AX25_UDEV_PTT_STATUS, AX25_UDEV_SET_MAC_VALUE, AX25_UDEV_REQUEST_RTS } ax25_user_dev_commands_t; typedef enum ax25_user_dev_capabilities_e { AX25_UDEV_CAP_HALF_DUPLEX, AX25_UDEV_CAP_FULL_DUPLEX, AX25_UDEV_CAP_ADVANCED_ARBITRATION, AX25_UDEV_CAP_OWN_ARBITRATION, AX25_UDEV_CAP_SIMPLE_ARBITRATION } ax25_user_dev_capabilities_t; typedef int ax25_udev_pt_t; typedef int ax25_udev_val_t; #endif /* __IF_AX25_UDEV_H */