2008-04-24 05:37:04 +07:00
|
|
|
#ifndef _ISP1760_HCD_H_
|
|
|
|
#define _ISP1760_HCD_H_
|
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
#include <linux/spinlock.h>
|
2015-01-21 05:55:45 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
struct isp1760_qh;
|
|
|
|
struct isp1760_qtd;
|
|
|
|
struct resource;
|
|
|
|
struct usb_hcd;
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
/*
|
|
|
|
* 60kb divided in:
|
|
|
|
* - 32 blocks @ 256 bytes
|
|
|
|
* - 20 blocks @ 1024 bytes
|
|
|
|
* - 4 blocks @ 8192 bytes
|
|
|
|
*/
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
#define BLOCK_1_NUM 32
|
|
|
|
#define BLOCK_2_NUM 20
|
|
|
|
#define BLOCK_3_NUM 4
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
#define BLOCK_1_SIZE 256
|
|
|
|
#define BLOCK_2_SIZE 1024
|
|
|
|
#define BLOCK_3_SIZE 8192
|
|
|
|
#define BLOCKS (BLOCK_1_NUM + BLOCK_2_NUM + BLOCK_3_NUM)
|
|
|
|
#define MAX_PAYLOAD_SIZE BLOCK_3_SIZE
|
|
|
|
#define PAYLOAD_AREA_SIZE 0xf000
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
struct isp1760_slotinfo {
|
|
|
|
struct isp1760_qh *qh;
|
|
|
|
struct isp1760_qtd *qtd;
|
|
|
|
unsigned long timestamp;
|
|
|
|
};
|
|
|
|
|
2008-04-24 05:37:04 +07:00
|
|
|
/* chip memory management */
|
2015-01-21 05:55:55 +07:00
|
|
|
struct isp1760_memory_chunk {
|
2008-04-24 05:37:04 +07:00
|
|
|
unsigned int start;
|
|
|
|
unsigned int size;
|
|
|
|
unsigned int free;
|
|
|
|
};
|
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
enum isp1760_queue_head_types {
|
|
|
|
QH_CONTROL,
|
|
|
|
QH_BULK,
|
|
|
|
QH_INTERRUPT,
|
|
|
|
QH_END
|
|
|
|
};
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
struct isp1760_hcd {
|
|
|
|
struct usb_hcd *hcd;
|
|
|
|
|
|
|
|
u32 hcs_params;
|
|
|
|
spinlock_t lock;
|
|
|
|
struct isp1760_slotinfo atl_slots[32];
|
|
|
|
int atl_done_map;
|
|
|
|
struct isp1760_slotinfo int_slots[32];
|
|
|
|
int int_done_map;
|
|
|
|
struct isp1760_memory_chunk memory_pool[BLOCKS];
|
|
|
|
struct list_head qh_list[QH_END];
|
|
|
|
|
|
|
|
/* periodic schedule support */
|
|
|
|
#define DEFAULT_I_TDPS 1024
|
|
|
|
unsigned periodic_size;
|
|
|
|
unsigned i_thresh;
|
|
|
|
unsigned long reset_done;
|
|
|
|
unsigned long next_statechange;
|
|
|
|
};
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:57 +07:00
|
|
|
int isp1760_hcd_register(struct isp1760_hcd *priv, void __iomem *regs,
|
|
|
|
struct resource *mem, int irq, unsigned long irqflags,
|
2015-01-21 05:55:59 +07:00
|
|
|
struct device *dev);
|
2015-01-21 05:55:57 +07:00
|
|
|
void isp1760_hcd_unregister(struct isp1760_hcd *priv);
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2015-01-21 05:55:56 +07:00
|
|
|
int isp1760_init_kmem_once(void);
|
|
|
|
void isp1760_deinit_kmem_cache(void);
|
2008-04-24 05:37:04 +07:00
|
|
|
|
2011-04-27 02:48:30 +07:00
|
|
|
#endif /* _ISP1760_HCD_H_ */
|