~ubuntu-branches/ubuntu/saucy/biosdevname/saucy-proposed

« back to all changes in this revision

Viewing changes to src/pirq.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-02-23 17:58:36 UTC
  • Revision ID: james.westby@ubuntu.com-20110223175836-4f0cbcno9zm0lmdu
Tags: upstream-0.3.7
ImportĀ upstreamĀ versionĀ 0.3.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PIRQ_H_INCLUDED
 
2
#define PIRQ_H_INCLUDED
 
3
 
 
4
/*
 
5
 * PCI IRQ Routing Table dumper
 
6
 *  Copyright (c) 2006 Dell, Inc.
 
7
 *  by Matt Domsch <Matt_Domsch@dell.com>
 
8
 *
 
9
 *  Based on the description of said table found at
 
10
 *  http://www.microsoft.com/hwdev/busbios/pciirq.htm
 
11
 *  Licensed under the GNU General Public license, version 2.
 
12
 */
 
13
 
 
14
#include <stdint.h>
 
15
#include <stdlib.h>
 
16
 
 
17
typedef unsigned char __u8;
 
18
typedef unsigned short int __u16;
 
19
typedef unsigned int __u32;
 
20
 
 
21
 
 
22
struct slot_entry {
 
23
        __u8  bus;
 
24
        __u8  device;
 
25
        __u8  inta_link;
 
26
        __u16 inta_irq;
 
27
        __u8  intb_link;
 
28
        __u16 intb_irq;
 
29
        __u8  intc_link;
 
30
        __u16 intc_irq;
 
31
        __u8  intd_link;
 
32
        __u16 intd_irq;
 
33
        __u8  slot;
 
34
        __u8  reserved;
 
35
} __attribute__((packed));
 
36
 
 
37
struct routing_table {
 
38
        __u32 signature;
 
39
        __u16 version;
 
40
        __u16 size;
 
41
        __u8  router_bus;
 
42
        __u8  router_devfn;
 
43
        __u16 exclusive_irqs;
 
44
        __u32 compatable_router;
 
45
        __u32 miniport_data;
 
46
        __u8  reserved[11];
 
47
        __u8  checksum;
 
48
        struct slot_entry slot[1];
 
49
} __attribute__((packed));
 
50
 
 
51
 
 
52
#define PCI_DEVICE(devfn)         (((devfn) >> 3) & 0x1f)
 
53
#define PCI_FUNC(devfn)         ((devfn) & 0x07)
 
54
extern struct routing_table * pirq_alloc_read_table(void);
 
55
extern void pirq_free_table(struct routing_table *table);
 
56
extern int pirq_pci_dev_to_slot(struct routing_table *table, int domain, int bus, int dev);
 
57
 
 
58
#endif /* PIRQ_H_INCLUDED */