File: isdn_compat.h

package info (click to toggle)
kernel-source-2.2.19 2.2.19.1-4woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 92,100 kB
  • ctags: 276,892
  • sloc: ansic: 1,710,384; asm: 58,709; makefile: 10,198; sh: 2,398; perl: 907; tcl: 570; lisp: 218; cpp: 186; awk: 133; sed: 72
file content (81 lines) | stat: -rw-r--r-- 1,886 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* Compatibility for various Linux kernel versions */

#ifndef _LINUX_ISDN_COMPAT_H
#define _LINUX_ISDN_COMPAT_H

#ifdef __KERNEL__


#include <linux/pci.h>
#ifdef __powerpc__
static inline int pci_enable_device(struct pci_dev *dev)
{
	u16 cmd;
	pci_read_config_word(dev, PCI_COMMAND, &cmd);
	cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO | PCI_COMMAND_SERR;
	cmd &= ~PCI_COMMAND_FAST_BACK;
	pci_write_config_word(dev, PCI_COMMAND, cmd);
	return(0);
}
#else
static inline int pci_enable_device(struct pci_dev *dev)
{
	return 0;
}
#endif /* __powerpc__ */

#define PCI_ANY_ID (~0)

/* as this is included multiple times, we make it inline */

static inline struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device,
					unsigned int ss_vendor, unsigned int ss_device,
					struct pci_dev *from)
{
	unsigned short subsystem_vendor, subsystem_device;

	while ((from = pci_find_device(vendor, device, from))) {
		pci_read_config_word(from, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
		pci_read_config_word(from, PCI_SUBSYSTEM_ID, &subsystem_device);
		if ((ss_vendor == PCI_ANY_ID || subsystem_vendor == ss_vendor) &&
		    (ss_device == PCI_ANY_ID || subsystem_device == ss_device))
			return from;
	}
	return NULL;
}

#include <linux/netdevice.h>

/*
 * Tell upper layers that the network device is ready to xmit more frames.
 */
static void __inline__ netif_wake_queue(struct device * dev)
{
	dev->tbusy = 0;
	mark_bh(NET_BH);
}

/*
 * called during net_device open()
 */
static void __inline__ netif_start_queue(struct device * dev)
{
	dev->tbusy = 0;
	/* actually, we never use the interrupt flag at all */
	dev->interrupt = 0;
	dev->start = 1;
}

/*
 * Ask upper layers to temporarily cease passing us more xmit frames.
 */
static void __inline__ netif_stop_queue(struct device * dev)
{
	dev->tbusy = 1;
}




#endif /* __KERNEL__ */
#endif /* _LINUX_ISDN_COMPAT_H */