Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
vio.h File Reference
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/timer.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/list.h>
#include <linux/log2.h>
#include <asm/ldc.h>
#include <asm/mdesc.h>

Go to the source code of this file.

Data Structures

struct  vio_msg_tag
 
struct  vio_rdx
 
struct  vio_ver_info
 
struct  vio_dring_register
 
struct  vio_dring_unregister
 
struct  vio_dring_data
 
struct  vio_dring_hdr
 
struct  vio_disk_attr_info
 
struct  vio_disk_desc
 
struct  vio_disk_vtoc
 
struct  vio_disk_geom
 
struct  vio_disk_devid
 
struct  vio_disk_efi
 
struct  vio_net_attr_info
 
struct  vio_net_mcast_info
 
struct  vio_net_desc
 
struct  vio_dring_state
 
struct  vio_dev
 
struct  vio_driver
 
struct  vio_version
 
struct  vio_driver_ops
 
struct  vio_completion
 
struct  vio_driver_state
 

Macros

#define VIO_TYPE_CTRL   0x01
 
#define VIO_TYPE_DATA   0x02
 
#define VIO_TYPE_ERR   0x04
 
#define VIO_SUBTYPE_INFO   0x01
 
#define VIO_SUBTYPE_ACK   0x02
 
#define VIO_SUBTYPE_NACK   0x04
 
#define VIO_VER_INFO   0x0001
 
#define VIO_ATTR_INFO   0x0002
 
#define VIO_DRING_REG   0x0003
 
#define VIO_DRING_UNREG   0x0004
 
#define VIO_RDX   0x0005
 
#define VIO_PKT_DATA   0x0040
 
#define VIO_DESC_DATA   0x0041
 
#define VIO_DRING_DATA   0x0042
 
#define VNET_MCAST_INFO   0x0101
 
#define VDEV_NETWORK   0x01
 
#define VDEV_NETWORK_SWITCH   0x02
 
#define VDEV_DISK   0x03
 
#define VDEV_DISK_SERVER   0x04
 
#define VIO_TX_DRING   0x0001
 
#define VIO_RX_DRING   0x0002
 
#define VIO_PKT_MODE   0x01 /* Packet based transfer */
 
#define VIO_DESC_MODE   0x02 /* In-band descriptors */
 
#define VIO_DRING_MODE   0x03 /* Descriptor rings */
 
#define VIO_DRING_ACTIVE   0x01
 
#define VIO_DRING_STOPPED   0x02
 
#define VIO_DESC_FREE   0x01
 
#define VIO_DESC_READY   0x02
 
#define VIO_DESC_ACCEPTED   0x03
 
#define VIO_DESC_DONE   0x04
 
#define VIO_ACK_ENABLE   0x01
 
#define VIO_ACK_DISABLE   0x00
 
#define VD_DISK_TYPE_SLICE   0x01 /* Slice in block device */
 
#define VD_DISK_TYPE_DISK   0x02 /* Entire block device */
 
#define VD_OP_BREAD   0x01 /* Block read */
 
#define VD_OP_BWRITE   0x02 /* Block write */
 
#define VD_OP_FLUSH   0x03 /* Flush disk contents */
 
#define VD_OP_GET_WCE   0x04 /* Get write-cache status */
 
#define VD_OP_SET_WCE   0x05 /* Enable/disable write-cache */
 
#define VD_OP_GET_VTOC   0x06 /* Get VTOC */
 
#define VD_OP_SET_VTOC   0x07 /* Set VTOC */
 
#define VD_OP_GET_DISKGEOM   0x08 /* Get disk geometry */
 
#define VD_OP_SET_DISKGEOM   0x09 /* Set disk geometry */
 
#define VD_OP_SCSICMD   0x0a /* SCSI control command */
 
#define VD_OP_GET_DEVID   0x0b /* Get device ID */
 
#define VD_OP_GET_EFI   0x0c /* Get EFI */
 
#define VD_OP_SET_EFI   0x0d /* Set EFI */
 
#define VIO_DISK_VNAME_LEN   8
 
#define VIO_DISK_ALABEL_LEN   128
 
#define VIO_DISK_NUM_PART   8
 
#define VNET_ADDR_ETHERMAC   0x01
 
#define VNET_NUM_MCAST   7
 
#define VIO_MAX_RING_COOKIES   24
 
#define VIO_MAX_TYPE_LEN   32
 
#define VIO_MAX_COMPAT_LEN   64
 
#define VIO_DRIVER_TX_RING   0
 
#define VIO_DRIVER_RX_RING   1
 
#define VIO_HS_INVALID   0x00
 
#define VIO_HS_GOTVERS   0x01
 
#define VIO_HS_GOT_ATTR   0x04
 
#define VIO_HS_SENT_DREG   0x08
 
#define VIO_HS_SENT_RDX   0x10
 
#define VIO_HS_GOT_RDX_ACK   0x20
 
#define VIO_HS_GOT_RDX   0x40
 
#define VIO_HS_SENT_RDX_ACK   0x80
 
#define VIO_HS_COMPLETE   (VIO_HS_GOT_RDX_ACK | VIO_HS_SENT_RDX_ACK)
 
#define VIO_DR_STATE_TXREG   0x01
 
#define VIO_DR_STATE_RXREG   0x02
 
#define VIO_DR_STATE_TXREQ   0x10
 
#define VIO_DR_STATE_RXREQ   0x20
 
#define VIO_DEBUG_HS   0x01
 
#define VIO_DEBUG_DATA   0x02
 
#define viodbg(TYPE, f, a...)
 
#define vio_register_driver(driver)   __vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
 

Functions

int __vio_register_driver (struct vio_driver *drv, struct module *owner, const char *mod_name)
 
void vio_unregister_driver (struct vio_driver *drv)
 
int vio_ldc_send (struct vio_driver_state *vio, void *data, int len)
 
void vio_link_state_change (struct vio_driver_state *vio, int event)
 
void vio_conn_reset (struct vio_driver_state *vio)
 
int vio_control_pkt_engine (struct vio_driver_state *vio, void *pkt)
 
int vio_validate_sid (struct vio_driver_state *vio, struct vio_msg_tag *tp)
 
u32 vio_send_sid (struct vio_driver_state *vio)
 
int vio_ldc_alloc (struct vio_driver_state *vio, struct ldc_channel_config *base_cfg, void *event_arg)
 
void vio_ldc_free (struct vio_driver_state *vio)
 
int vio_driver_init (struct vio_driver_state *vio, struct vio_dev *vdev, u8 dev_class, struct vio_version *ver_table, int ver_table_size, struct vio_driver_ops *ops, char *name)
 
void vio_port_up (struct vio_driver_state *vio)
 

Macro Definition Documentation

#define VD_DISK_TYPE_DISK   0x02 /* Entire block device */

Definition at line 120 of file vio.h.

#define VD_DISK_TYPE_SLICE   0x01 /* Slice in block device */

Definition at line 119 of file vio.h.

#define VD_OP_BREAD   0x01 /* Block read */

Definition at line 133 of file vio.h.

#define VD_OP_BWRITE   0x02 /* Block write */

Definition at line 134 of file vio.h.

#define VD_OP_FLUSH   0x03 /* Flush disk contents */

Definition at line 135 of file vio.h.

#define VD_OP_GET_DEVID   0x0b /* Get device ID */

Definition at line 143 of file vio.h.

#define VD_OP_GET_DISKGEOM   0x08 /* Get disk geometry */

Definition at line 140 of file vio.h.

#define VD_OP_GET_EFI   0x0c /* Get EFI */

Definition at line 144 of file vio.h.

#define VD_OP_GET_VTOC   0x06 /* Get VTOC */

Definition at line 138 of file vio.h.

#define VD_OP_GET_WCE   0x04 /* Get write-cache status */

Definition at line 136 of file vio.h.

#define VD_OP_SCSICMD   0x0a /* SCSI control command */

Definition at line 142 of file vio.h.

#define VD_OP_SET_DISKGEOM   0x09 /* Set disk geometry */

Definition at line 141 of file vio.h.

#define VD_OP_SET_EFI   0x0d /* Set EFI */

Definition at line 145 of file vio.h.

#define VD_OP_SET_VTOC   0x07 /* Set VTOC */

Definition at line 139 of file vio.h.

#define VD_OP_SET_WCE   0x05 /* Enable/disable write-cache */

Definition at line 137 of file vio.h.

#define VDEV_DISK   0x03

Definition at line 53 of file vio.h.

#define VDEV_DISK_SERVER   0x04

Definition at line 54 of file vio.h.

#define VDEV_NETWORK   0x01

Definition at line 51 of file vio.h.

#define VDEV_NETWORK_SWITCH   0x02

Definition at line 52 of file vio.h.

#define VIO_ACK_DISABLE   0x00

Definition at line 108 of file vio.h.

#define VIO_ACK_ENABLE   0x01

Definition at line 107 of file vio.h.

#define VIO_ATTR_INFO   0x0002

Definition at line 29 of file vio.h.

#define VIO_DEBUG_DATA   0x02

Definition at line 348 of file vio.h.

#define VIO_DEBUG_HS   0x01

Definition at line 347 of file vio.h.

#define VIO_DESC_ACCEPTED   0x03

Definition at line 104 of file vio.h.

#define VIO_DESC_DATA   0x0041

Definition at line 34 of file vio.h.

#define VIO_DESC_DONE   0x04

Definition at line 105 of file vio.h.

#define VIO_DESC_FREE   0x01

Definition at line 102 of file vio.h.

#define VIO_DESC_MODE   0x02 /* In-band descriptors */

Definition at line 81 of file vio.h.

#define VIO_DESC_READY   0x02

Definition at line 103 of file vio.h.

#define VIO_DISK_ALABEL_LEN   128

Definition at line 157 of file vio.h.

#define VIO_DISK_NUM_PART   8

Definition at line 158 of file vio.h.

#define VIO_DISK_VNAME_LEN   8

Definition at line 156 of file vio.h.

#define VIO_DR_STATE_RXREG   0x02

Definition at line 342 of file vio.h.

#define VIO_DR_STATE_RXREQ   0x20

Definition at line 344 of file vio.h.

#define VIO_DR_STATE_TXREG   0x01

Definition at line 341 of file vio.h.

#define VIO_DR_STATE_TXREQ   0x10

Definition at line 343 of file vio.h.

#define VIO_DRING_ACTIVE   0x01

Definition at line 91 of file vio.h.

#define VIO_DRING_DATA   0x0042

Definition at line 35 of file vio.h.

#define VIO_DRING_MODE   0x03 /* Descriptor rings */

Definition at line 82 of file vio.h.

#define VIO_DRING_REG   0x0003

Definition at line 30 of file vio.h.

#define VIO_DRING_STOPPED   0x02

Definition at line 92 of file vio.h.

#define VIO_DRING_UNREG   0x0004

Definition at line 31 of file vio.h.

#define VIO_DRIVER_RX_RING   1

Definition at line 325 of file vio.h.

#define VIO_DRIVER_TX_RING   0

Definition at line 324 of file vio.h.

#define VIO_HS_COMPLETE   (VIO_HS_GOT_RDX_ACK | VIO_HS_SENT_RDX_ACK)

Definition at line 336 of file vio.h.

#define VIO_HS_GOT_ATTR   0x04

Definition at line 330 of file vio.h.

#define VIO_HS_GOT_RDX   0x40

Definition at line 334 of file vio.h.

#define VIO_HS_GOT_RDX_ACK   0x20

Definition at line 333 of file vio.h.

#define VIO_HS_GOTVERS   0x01

Definition at line 329 of file vio.h.

#define VIO_HS_INVALID   0x00

Definition at line 328 of file vio.h.

#define VIO_HS_SENT_DREG   0x08

Definition at line 331 of file vio.h.

#define VIO_HS_SENT_RDX   0x10

Definition at line 332 of file vio.h.

#define VIO_HS_SENT_RDX_ACK   0x80

Definition at line 335 of file vio.h.

#define VIO_MAX_COMPAT_LEN   64

Definition at line 266 of file vio.h.

#define VIO_MAX_RING_COOKIES   24

Definition at line 231 of file vio.h.

#define VIO_MAX_TYPE_LEN   32

Definition at line 265 of file vio.h.

#define VIO_PKT_DATA   0x0040

Definition at line 33 of file vio.h.

#define VIO_PKT_MODE   0x01 /* Packet based transfer */

Definition at line 80 of file vio.h.

#define VIO_RDX   0x0005

Definition at line 32 of file vio.h.

#define vio_register_driver (   driver)    __vio_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)

Definition at line 380 of file vio.h.

#define VIO_RX_DRING   0x0002

Definition at line 67 of file vio.h.

#define VIO_SUBTYPE_ACK   0x02

Definition at line 24 of file vio.h.

#define VIO_SUBTYPE_INFO   0x01

Definition at line 23 of file vio.h.

#define VIO_SUBTYPE_NACK   0x04

Definition at line 25 of file vio.h.

#define VIO_TX_DRING   0x0001

Definition at line 66 of file vio.h.

#define VIO_TYPE_CTRL   0x01

Definition at line 18 of file vio.h.

#define VIO_TYPE_DATA   0x02

Definition at line 19 of file vio.h.

#define VIO_TYPE_ERR   0x04

Definition at line 20 of file vio.h.

#define VIO_VER_INFO   0x0001

Definition at line 28 of file vio.h.

#define viodbg (   TYPE,
  f,
  a... 
)
Value:
do { if (vio->debug & VIO_DEBUG_##TYPE) \
printk(KERN_INFO "vio: ID[%lu] " f, \
vio->vdev->channel_id, ## a); \
} while (0)

Definition at line 369 of file vio.h.

#define VNET_ADDR_ETHERMAC   0x01

Definition at line 206 of file vio.h.

#define VNET_MCAST_INFO   0x0101

Definition at line 36 of file vio.h.

#define VNET_NUM_MCAST   7

Definition at line 214 of file vio.h.

Function Documentation

int __vio_register_driver ( struct vio_driver viodrv,
struct module owner,
const char mod_name 
)

vio_register_driver: - Register a new vio driver : The vio_driver structure to be registered.

Definition at line 1265 of file vio.c.

void vio_conn_reset ( struct vio_driver_state vio)

Definition at line 648 of file viohs.c.

int vio_control_pkt_engine ( struct vio_driver_state vio,
void pkt 
)

Definition at line 608 of file viohs.c.

int vio_driver_init ( struct vio_driver_state vio,
struct vio_dev vdev,
u8  dev_class,
struct vio_version ver_table,
int  ver_table_size,
struct vio_driver_ops ops,
char name 
)

Definition at line 781 of file viohs.c.

int vio_ldc_alloc ( struct vio_driver_state vio,
struct ldc_channel_config base_cfg,
void event_arg 
)

Definition at line 707 of file viohs.c.

void vio_ldc_free ( struct vio_driver_state vio)

Definition at line 727 of file viohs.c.

int vio_ldc_send ( struct vio_driver_state vio,
void data,
int  len 
)

Definition at line 16 of file viohs.c.

void vio_link_state_change ( struct vio_driver_state vio,
int  event 
)

Definition at line 99 of file viohs.c.

void vio_port_up ( struct vio_driver_state vio)

Definition at line 738 of file viohs.c.

u32 vio_send_sid ( struct vio_driver_state vio)

Definition at line 692 of file viohs.c.

void vio_unregister_driver ( struct vio_driver viodrv)

vio_unregister_driver - Remove registration of vio driver. : The vio_driver struct to be removed form registration

Definition at line 1285 of file vio.c.

int vio_validate_sid ( struct vio_driver_state vio,
struct vio_msg_tag tp 
)

Definition at line 658 of file viohs.c.