diff options
Diffstat (limited to 'drivers/ieee1394/hosts.h')
-rw-r--r-- | drivers/ieee1394/hosts.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index 9ad4b2463077..bc6dbfadb891 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h | |||
@@ -2,17 +2,19 @@ | |||
2 | #define _IEEE1394_HOSTS_H | 2 | #define _IEEE1394_HOSTS_H |
3 | 3 | ||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/wait.h> | ||
6 | #include <linux/list.h> | 5 | #include <linux/list.h> |
7 | #include <linux/timer.h> | ||
8 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | #include <linux/timer.h> | ||
8 | #include <linux/types.h> | ||
9 | #include <linux/workqueue.h> | ||
10 | #include <asm/atomic.h> | ||
9 | 11 | ||
10 | #include <asm/semaphore.h> | 12 | struct pci_dev; |
13 | struct module; | ||
11 | 14 | ||
12 | #include "ieee1394_types.h" | 15 | #include "ieee1394_types.h" |
13 | #include "csr.h" | 16 | #include "csr.h" |
14 | 17 | ||
15 | |||
16 | struct hpsb_packet; | 18 | struct hpsb_packet; |
17 | struct hpsb_iso; | 19 | struct hpsb_iso; |
18 | 20 | ||
@@ -33,7 +35,6 @@ struct hpsb_host { | |||
33 | int node_count; /* number of identified nodes on this bus */ | 35 | int node_count; /* number of identified nodes on this bus */ |
34 | int selfid_count; /* total number of SelfIDs received */ | 36 | int selfid_count; /* total number of SelfIDs received */ |
35 | int nodes_active; /* number of nodes with active link layer */ | 37 | int nodes_active; /* number of nodes with active link layer */ |
36 | u8 speed[ALL_NODES]; /* speed between each node and local node */ | ||
37 | 38 | ||
38 | nodeid_t node_id; /* node ID of this host */ | 39 | nodeid_t node_id; /* node ID of this host */ |
39 | nodeid_t irm_id; /* ID of this bus' isochronous resource manager */ | 40 | nodeid_t irm_id; /* ID of this bus' isochronous resource manager */ |
@@ -53,31 +54,29 @@ struct hpsb_host { | |||
53 | int reset_retries; | 54 | int reset_retries; |
54 | quadlet_t *topology_map; | 55 | quadlet_t *topology_map; |
55 | u8 *speed_map; | 56 | u8 *speed_map; |
56 | struct csr_control csr; | ||
57 | |||
58 | /* Per node tlabel pool allocation */ | ||
59 | struct hpsb_tlabel_pool tpool[ALL_NODES]; | ||
60 | 57 | ||
58 | int id; | ||
61 | struct hpsb_host_driver *driver; | 59 | struct hpsb_host_driver *driver; |
62 | |||
63 | struct pci_dev *pdev; | 60 | struct pci_dev *pdev; |
64 | |||
65 | int id; | ||
66 | |||
67 | struct device device; | 61 | struct device device; |
68 | struct class_device class_dev; | 62 | struct class_device class_dev; |
69 | 63 | ||
70 | int update_config_rom; | 64 | int update_config_rom; |
71 | struct work_struct delayed_reset; | 65 | struct work_struct delayed_reset; |
72 | |||
73 | unsigned int config_roms; | 66 | unsigned int config_roms; |
74 | 67 | ||
75 | struct list_head addr_space; | 68 | struct list_head addr_space; |
76 | u64 low_addr_space; /* upper bound of physical DMA area */ | 69 | u64 low_addr_space; /* upper bound of physical DMA area */ |
77 | u64 middle_addr_space; /* upper bound of posted write area */ | 70 | u64 middle_addr_space; /* upper bound of posted write area */ |
78 | }; | ||
79 | 71 | ||
72 | u8 speed[ALL_NODES]; /* speed between each node and local node */ | ||
73 | |||
74 | /* per node tlabel allocation */ | ||
75 | u8 next_tl[ALL_NODES]; | ||
76 | struct { DECLARE_BITMAP(map, 64); } tl_pool[ALL_NODES]; | ||
80 | 77 | ||
78 | struct csr_control csr; | ||
79 | }; | ||
81 | 80 | ||
82 | enum devctl_cmd { | 81 | enum devctl_cmd { |
83 | /* Host is requested to reset its bus and cancel all outstanding async | 82 | /* Host is requested to reset its bus and cancel all outstanding async |
@@ -112,7 +111,7 @@ enum devctl_cmd { | |||
112 | 111 | ||
113 | enum isoctl_cmd { | 112 | enum isoctl_cmd { |
114 | /* rawiso API - see iso.h for the meanings of these commands | 113 | /* rawiso API - see iso.h for the meanings of these commands |
115 | (they correspond exactly to the hpsb_iso_* API functions) | 114 | * (they correspond exactly to the hpsb_iso_* API functions) |
116 | * INIT = allocate resources | 115 | * INIT = allocate resources |
117 | * START = begin transmission/reception | 116 | * START = begin transmission/reception |
118 | * STOP = halt transmission/reception | 117 | * STOP = halt transmission/reception |
@@ -160,7 +159,8 @@ struct hpsb_host_driver { | |||
160 | /* The hardware driver may optionally support a function that is used | 159 | /* The hardware driver may optionally support a function that is used |
161 | * to set the hardware ConfigROM if the hardware supports handling | 160 | * to set the hardware ConfigROM if the hardware supports handling |
162 | * reads to the ConfigROM on its own. */ | 161 | * reads to the ConfigROM on its own. */ |
163 | void (*set_hw_config_rom) (struct hpsb_host *host, quadlet_t *config_rom); | 162 | void (*set_hw_config_rom)(struct hpsb_host *host, |
163 | quadlet_t *config_rom); | ||
164 | 164 | ||
165 | /* This function shall implement packet transmission based on | 165 | /* This function shall implement packet transmission based on |
166 | * packet->type. It shall CRC both parts of the packet (unless | 166 | * packet->type. It shall CRC both parts of the packet (unless |
@@ -170,20 +170,21 @@ struct hpsb_host_driver { | |||
170 | * called. Return 0 on success, negative errno on failure. | 170 | * called. Return 0 on success, negative errno on failure. |
171 | * NOTE: The function must be callable in interrupt context. | 171 | * NOTE: The function must be callable in interrupt context. |
172 | */ | 172 | */ |
173 | int (*transmit_packet) (struct hpsb_host *host, | 173 | int (*transmit_packet)(struct hpsb_host *host, |
174 | struct hpsb_packet *packet); | 174 | struct hpsb_packet *packet); |
175 | 175 | ||
176 | /* This function requests miscellanous services from the driver, see | 176 | /* This function requests miscellanous services from the driver, see |
177 | * above for command codes and expected actions. Return -1 for unknown | 177 | * above for command codes and expected actions. Return -1 for unknown |
178 | * command, though that should never happen. | 178 | * command, though that should never happen. |
179 | */ | 179 | */ |
180 | int (*devctl) (struct hpsb_host *host, enum devctl_cmd command, int arg); | 180 | int (*devctl)(struct hpsb_host *host, enum devctl_cmd command, int arg); |
181 | 181 | ||
182 | /* ISO transmission/reception functions. Return 0 on success, -1 | 182 | /* ISO transmission/reception functions. Return 0 on success, -1 |
183 | * (or -EXXX errno code) on failure. If the low-level driver does not | 183 | * (or -EXXX errno code) on failure. If the low-level driver does not |
184 | * support the new ISO API, set isoctl to NULL. | 184 | * support the new ISO API, set isoctl to NULL. |
185 | */ | 185 | */ |
186 | int (*isoctl) (struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg); | 186 | int (*isoctl)(struct hpsb_iso *iso, enum isoctl_cmd command, |
187 | unsigned long arg); | ||
187 | 188 | ||
188 | /* This function is mainly to redirect local CSR reads/locks to the iso | 189 | /* This function is mainly to redirect local CSR reads/locks to the iso |
189 | * management registers (bus manager id, bandwidth available, channels | 190 | * management registers (bus manager id, bandwidth available, channels |
@@ -196,19 +197,11 @@ struct hpsb_host_driver { | |||
196 | quadlet_t data, quadlet_t compare); | 197 | quadlet_t data, quadlet_t compare); |
197 | }; | 198 | }; |
198 | 199 | ||
199 | |||
200 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | 200 | struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, |
201 | struct device *dev); | 201 | struct device *dev); |
202 | int hpsb_add_host(struct hpsb_host *host); | 202 | int hpsb_add_host(struct hpsb_host *host); |
203 | void hpsb_remove_host(struct hpsb_host *h); | 203 | void hpsb_remove_host(struct hpsb_host *h); |
204 | 204 | ||
205 | /* The following 2 functions are deprecated and will be removed when the | ||
206 | * raw1394/libraw1394 update is complete. */ | ||
207 | int hpsb_update_config_rom(struct hpsb_host *host, | ||
208 | const quadlet_t *new_rom, size_t size, unsigned char rom_version); | ||
209 | int hpsb_get_config_rom(struct hpsb_host *host, quadlet_t *buffer, | ||
210 | size_t buffersize, size_t *rom_size, unsigned char *rom_version); | ||
211 | |||
212 | /* Updates the configuration rom image of a host. rom_version must be the | 205 | /* Updates the configuration rom image of a host. rom_version must be the |
213 | * current version, otherwise it will fail with return value -1. If this | 206 | * current version, otherwise it will fail with return value -1. If this |
214 | * host does not support config-rom-update, it will return -EINVAL. | 207 | * host does not support config-rom-update, it will return -EINVAL. |