aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base/RaspberryPi/FreeRTOS/mmio.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-10-09 12:29:26 +1000
committerinmarket <andrewh@inmarket.com.au>2014-10-09 12:31:53 +1000
commit8e42404e7cdfcd568afac6b6a1ad0d0c825da0ff (patch)
tree26521af6e88c94ad0f6ee8be10d2dfec612cfb09 /boards/base/RaspberryPi/FreeRTOS/mmio.h
parenta40283c92becd977cfad0c4b01ca069de23eacbf (diff)
downloaduGFX-8e42404e7cdfcd568afac6b6a1ad0d0c825da0ff.tar.gz
uGFX-8e42404e7cdfcd568afac6b6a1ad0d0c825da0ff.tar.bz2
uGFX-8e42404e7cdfcd568afac6b6a1ad0d0c825da0ff.zip
Fixes bug with printf formatting of zero filled fields
Diffstat (limited to 'boards/base/RaspberryPi/FreeRTOS/mmio.h')
0 files changed, 0 insertions, 0 deletions
href='#n106'>106 107 108 109 110
/******************************************************************************
 * arch/xen/drivers/netif/backend/common.h
 */

#ifndef __NETIF__BACKEND__COMMON_H__
#define __NETIF__BACKEND__COMMON_H__

#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/ip.h>
#include <linux/in.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <xen/evtchn.h>
#include <xen/interface/io/netif.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
#include <xen/interface/grant_table.h>
#include <xen/gnttab.h>
#include <xen/driver_util.h>

#define DPRINTK(_f, _a...) pr_debug("(file=%s, line=%d) " _f, \
                                    __FILE__ , __LINE__ , ## _a )
#define IPRINTK(fmt, args...) \
    printk(KERN_INFO "xen_net: " fmt, ##args)
#define WPRINTK(fmt, args...) \
    printk(KERN_WARNING "xen_net: " fmt, ##args)

typedef struct netif_st {
	/* Unique identifier for this interface. */
	domid_t          domid;
	unsigned int     handle;

	u8               fe_dev_addr[6];

	/* Physical parameters of the comms window. */
	grant_handle_t   tx_shmem_handle;
	grant_ref_t      tx_shmem_ref; 
	grant_handle_t   rx_shmem_handle;
	grant_ref_t      rx_shmem_ref; 
	unsigned int     evtchn;
	unsigned int     irq;

	/* The shared rings and indexes. */
	netif_tx_back_ring_t tx;
	netif_rx_back_ring_t rx;
	struct vm_struct *tx_comms_area;
	struct vm_struct *rx_comms_area;

	/* Allow netif_be_start_xmit() to peek ahead in the rx request ring. */
	RING_IDX rx_req_cons_peek;

	/* Transmit shaping: allow 'credit_bytes' every 'credit_usec'. */
	unsigned long   credit_bytes;
	unsigned long   credit_usec;
	unsigned long   remaining_credit;
	struct timer_list credit_timeout;

	/* Miscellaneous private stuff. */
	enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
	int active;
	struct list_head list;  /* scheduling list */
	atomic_t         refcnt;
	struct net_device *dev;
	struct net_device_stats stats;

	struct work_struct free_work;
} netif_t;

#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE)
#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE)

void netif_creditlimit(netif_t *netif);
void netif_disconnect(netif_t *netif);

netif_t *alloc_netif(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN]);
void free_netif(netif_t *netif);
int netif_map(netif_t *netif, unsigned long tx_ring_ref,
	      unsigned long rx_ring_ref, unsigned int evtchn);

#define netif_get(_b) (atomic_inc(&(_b)->refcnt))
#define netif_put(_b)						\
	do {							\
		if ( atomic_dec_and_test(&(_b)->refcnt) )	\
			free_netif(_b);				\
	} while (0)

void netif_xenbus_init(void);

void netif_schedule_work(netif_t *netif);
void netif_deschedule_work(netif_t *netif);

int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev);
struct net_device_stats *netif_be_get_stats(struct net_device *dev);
irqreturn_t netif_be_int(int irq, void *dev_id, struct pt_regs *regs);

#endif /* __NETIF__BACKEND__COMMON_H__ */

/*
 * Local variables:
 *  c-file-style: "linux"
 *  indent-tabs-mode: t
 *  c-indent-level: 8
 *  c-basic-offset: 8
 *  tab-width: 8
 * End:
 */