struct bcm_driver {
        int (*init)(struct dev_info *dev);
        void (*remove)(struct dev_info *dev);
}

struct bcm_payload {
        u32 proto;
        void (*tx_notify)(struct dev_info *, struct bcm_transfer *);
        void (*rx_action)(struct dev_info *, struct bcm_transfer *);
}

struct bcm_transfer {
        struct dev_info *dev;
        u8 *            buffer;
        size_t          len;
        u32             proto;	/* semantics TBD */
        u32             flags;	/* semantics TBD */
        struct bcm_transfer *next;
};

struct dev_info {
        struct bcm_dev  *bcm;
	char 		identity[64]; /* semantics TBD */
};


The api is symmetric, and used the same way in both host and device.

Only 5 functions in the api: 
register (and unregister) a driver.
register (and unregistet) data.
transmit data.


int bcm_register_driver(struct bcm_driver *) -

This function registers a driver. the driver's init function is called once for 
every device deteced. 


int register_bcm_payload(struct dev_info *, struct bcm_payload *) - 

This registers a payload structure. 
The tx_notify function is called  whenever a requested transmit with 
the requested protocol, to the requested device ends. The function is 
called in process context (keventd, by schedule_task). The function should 
free the buffer (bcm_transfer->buffer), and the bcm_transfer structure itself.
They are both allocated by the driver, with kmalloc.
finished transfers with no tx_notification registered, are cleaned up by the driver.

The rx_action function is called whenever a transmit from the requested 
card (with the requested protocol). The function is called in process context 
(keventd, by schedule_task). The function should free the buffer (bcm_transfer->buffer), 
and the bcm_transfer structure itself. They are both allocated by the driver, with 
kmalloc. finished transfers with no rx_action registered, are cleaned up by the driver.

Only one payload can be registered per protocol per device. A second register_bcm_payload with
the same protocol number and device overwrites the first. 

The functions might not be called for transfers that started before registration, 
even if they end after.


int bcm_transmit_data(struct bcm_transfer *tr) -

Transmits the data pointed to by bcm_transfer. 
The application should fill the fields:
dev - the device to send this data to.
buffer - a pointer the buffer that contains the data to transmit, allocated 
with kmalloc. It will be freed by the driver after the transfer, only if there 
is no tx_notify function for this data.
len - size of data.
proto - protocol number.
flags - logical or of transfer flags:
	FLAGS_NOTIFY - genetrate tx_notification at the end of this transmit. 


