Revision 54866f032307063776b4eff7eadb131d47f9f9b4 authored by Linus Torvalds on 01 November 2007, 19:09:33 UTC, committed by Linus Torvalds on 01 November 2007, 19:09:33 UTC
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IRDA] IRNET: Fix build when TCGETS2 is defined.
  [NET]: docbook fixes for netif_ functions
  [NET]: Hide the net_ns kmem cache
  [NET]: Mark the setup_net as __net_init
  [NET]: Hide the dead code in the net_namespace.c
  [NET]: Relax the reference counting of init_net_ns
  [NETNS]: Make the init/exit hooks checks outside the loop
  [NET]: Forget the zero_it argument of sk_alloc()
  [NET]: Remove bogus zero_it argument from sk_alloc
  [NET]: Make the sk_clone() lighter
  [NET]: Move some core sock setup into sk_prot_alloc
  [NET]: Auto-zero the allocated sock object
  [NET]: Cleanup the allocation/freeing of the sock object
  [NET]: Move the get_net() from sock_copy()
  [NET]: Move the sock_copy() from the header
  [TCP]: Another TAGBITS -> SACKED_ACKED|LOST conversion
  [TCP]: Process DSACKs that reside within a SACK block
2 parent s b4d367f + 49259d3
Raw File
rtlx.h
/*
 * Copyright (C) 2004, 2005 MIPS Technologies, Inc.  All rights reserved.
 *
 */

#ifndef __ASM_RTLX_H
#define __ASM_RTLX_H_

#include <irq.h>

#define LX_NODE_BASE 10

#define MIPS_CPU_RTLX_IRQ 0

#define RTLX_VERSION 2
#define RTLX_xID 0x12345600
#define RTLX_ID (RTLX_xID | RTLX_VERSION)
#define RTLX_CHANNELS 8

#define RTLX_CHANNEL_STDIO	0
#define RTLX_CHANNEL_DBG	1
#define RTLX_CHANNEL_SYSIO	2

extern int rtlx_open(int index, int can_sleep);
extern int rtlx_release(int index);
extern ssize_t rtlx_read(int index, void __user *buff, size_t count);
extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count);
extern unsigned int rtlx_read_poll(int index, int can_sleep);
extern unsigned int rtlx_write_poll(int index);

enum rtlx_state {
	RTLX_STATE_UNUSED,
	RTLX_STATE_INITIALISED,
	RTLX_STATE_REMOTE_READY,
	RTLX_STATE_OPENED
};

#define RTLX_BUFFER_SIZE 1024

/* each channel supports read and write.
   linux (vpe0) reads lx_buffer  and writes rt_buffer
   SP (vpe1) reads rt_buffer and writes lx_buffer
*/
struct rtlx_channel {
	enum rtlx_state rt_state;
	enum rtlx_state lx_state;

	int buffer_size;

	/* read and write indexes per buffer */
	int rt_write, rt_read;
	char *rt_buffer;

	int lx_write, lx_read;
	char *lx_buffer;
};

struct rtlx_info {
	unsigned long id;
	enum rtlx_state state;

	struct rtlx_channel channel[RTLX_CHANNELS];
};

#endif /* __ASM_RTLX_H_ */
back to top