patch-2.4.21 linux-2.4.21/drivers/ieee1394/hosts.h
Next file: linux-2.4.21/drivers/ieee1394/ieee1394-ioctl.h
Previous file: linux-2.4.21/drivers/ieee1394/hosts.c
Back to the patch index
Back to the overall index
- Lines: 164
- Date:
2003-06-13 07:51:34.000000000 -0700
- Orig file:
linux-2.4.20/drivers/ieee1394/hosts.h
- Orig date:
2002-11-28 15:53:13.000000000 -0800
diff -urN linux-2.4.20/drivers/ieee1394/hosts.h linux-2.4.21/drivers/ieee1394/hosts.h
@@ -2,15 +2,24 @@
#define _IEEE1394_HOSTS_H
#include <linux/wait.h>
-#include <linux/tqueue.h>
#include <linux/list.h>
+#include <linux/tqueue.h>
#include <asm/semaphore.h>
#include "ieee1394_types.h"
#include "csr.h"
+/* size of the array used to store config rom (in quadlets)
+ maximum is 0x100. About 0x40 is needed for the default
+ entries. So 0x80 should provide enough space for additional
+ directories etc.
+ Note: All lowlevel drivers are required to allocate at least
+ this amount of memory for the configuration rom!
+*/
+#define CSR_CONFIG_ROM_SIZE 0x100
struct hpsb_packet;
+struct hpsb_iso;
struct hpsb_host {
struct list_head host_list;
@@ -25,13 +34,6 @@
spinlock_t pending_pkt_lock;
struct tq_struct timeout_tq;
- /* A bitmask where a set bit means that this tlabel is in use.
- * FIXME - should be handled per node instead of per bus. */
- u32 tlabel_pool[2];
- struct semaphore tlabel_count;
- spinlock_t tlabel_lock;
- u32 tlabel_current;
-
unsigned char iso_listen_count[64];
int node_count; /* number of identified nodes on this bus */
@@ -57,9 +59,14 @@
u8 *speed_map;
struct csr_control csr;
+ /* Per node tlabel pool allocation */
+ struct hpsb_tlabel_pool tpool[64];
+
struct hpsb_host_driver *driver;
struct pci_dev *pdev;
+
+ int id;
};
@@ -101,6 +108,31 @@
ISO_UNLISTEN_CHANNEL
};
+enum isoctl_cmd {
+ /* rawiso API - see iso.h for the meanings of these commands
+ * INIT = allocate resources
+ * START = begin transmission/reception
+ * STOP = halt transmission/reception
+ * QUEUE/RELEASE = produce/consume packets
+ * SHUTDOWN = deallocate resources
+ */
+
+ XMIT_INIT,
+ XMIT_START,
+ XMIT_STOP,
+ XMIT_QUEUE,
+ XMIT_SHUTDOWN,
+
+ RECV_INIT,
+ RECV_LISTEN_CHANNEL, /* multi-channel only */
+ RECV_UNLISTEN_CHANNEL, /* multi-channel only */
+ RECV_SET_CHANNEL_MASK, /* multi-channel only; arg is a *u64 */
+ RECV_START,
+ RECV_STOP,
+ RECV_RELEASE,
+ RECV_SHUTDOWN,
+};
+
enum reset_types {
/* 166 microsecond reset -- only type of reset available on
non-1394a capable IEEE 1394 controllers */
@@ -108,7 +140,13 @@
/* Short (arbitrated) reset -- only available on 1394a capable
IEEE 1394 capable controllers */
- SHORT_RESET
+ SHORT_RESET,
+
+ /* Variants, that set force_root before issueing the bus reset */
+ LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT,
+
+ /* Variants, that clear force_root before issueing the bus reset */
+ LONG_RESET_NO_FORCE_ROOT, SHORT_RESET_NO_FORCE_ROOT
};
struct hpsb_host_driver {
@@ -119,7 +157,7 @@
* may not fail. If any allocation is required, it must be done
* earlier.
*/
- size_t (*get_rom) (struct hpsb_host *host, const quadlet_t **pointer);
+ size_t (*get_rom) (struct hpsb_host *host, quadlet_t **pointer);
/* This function shall implement packet transmission based on
* packet->type. It shall CRC both parts of the packet (unless
@@ -138,6 +176,12 @@
*/
int (*devctl) (struct hpsb_host *host, enum devctl_cmd command, int arg);
+ /* ISO transmission/reception functions. Return 0 on success, -1
+ * (or -EXXX errno code) on failure. If the low-level driver does not
+ * support the new ISO API, set isoctl to NULL.
+ */
+ int (*isoctl) (struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg);
+
/* This function is mainly to redirect local CSR reads/locks to the iso
* management registers (bus manager id, bandwidth available, channels
* available) to the hardware registers in OHCI. reg is 0,1,2,3 for bus
@@ -149,12 +193,9 @@
quadlet_t data, quadlet_t compare);
};
-/* core internal use */
-void register_builtin_lowlevels(void);
-/* high level internal use */
-struct hpsb_highlevel;
-void hl_all_hosts(void (*function)(struct hpsb_host*));
+extern struct list_head hpsb_hosts;
+extern struct semaphore hpsb_hosts_lock;
/*
@@ -172,4 +213,24 @@
void hpsb_add_host(struct hpsb_host *host);
void hpsb_remove_host(struct hpsb_host *h);
+/* updates the configuration rom of a host.
+ * rom_version must be the current version,
+ * otherwise it will fail with return value -1.
+ * Return value -2 indicates that the new
+ * rom version is too big.
+ * Return value 0 indicates success
+ */
+int hpsb_update_config_rom(struct hpsb_host *host,
+ const quadlet_t *new_rom, size_t size, unsigned char rom_version);
+
+/* reads the current version of the configuration rom of a host.
+ * buffersize is the size of the buffer, rom_size
+ * returns the size of the current rom image.
+ * rom_version is the version number of the fetched rom.
+ * return value -1 indicates, that the buffer was
+ * too small, 0 indicates success.
+ */
+int hpsb_get_config_rom(struct hpsb_host *host, quadlet_t *buffer,
+ size_t buffersize, size_t *rom_size, unsigned char *rom_version);
+
#endif /* _IEEE1394_HOSTS_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)