diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 5d92d57b6f54..e9f374fb641e 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _IPATH_KERNEL_H | 1 | #ifndef _IPATH_KERNEL_H |
2 | #define _IPATH_KERNEL_H | 2 | #define _IPATH_KERNEL_H |
3 | /* | 3 | /* |
4 | * Copyright (c) 2006 QLogic, Inc. All rights reserved. | ||
4 | * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. | 5 | * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. |
5 | * | 6 | * |
6 | * This software is available to you under a choice of one of two | 7 | * This software is available to you under a choice of one of two |
@@ -61,9 +62,7 @@ struct ipath_portdata { | |||
61 | /* rcvhdrq base, needs mmap before useful */ | 62 | /* rcvhdrq base, needs mmap before useful */ |
62 | void *port_rcvhdrq; | 63 | void *port_rcvhdrq; |
63 | /* kernel virtual address where hdrqtail is updated */ | 64 | /* kernel virtual address where hdrqtail is updated */ |
64 | u64 *port_rcvhdrtail_kvaddr; | 65 | volatile __le64 *port_rcvhdrtail_kvaddr; |
65 | /* page * used for uaddr */ | ||
66 | struct page *port_rcvhdrtail_pagep; | ||
67 | /* | 66 | /* |
68 | * temp buffer for expected send setup, allocated at open, instead | 67 | * temp buffer for expected send setup, allocated at open, instead |
69 | * of each setup call | 68 | * of each setup call |
@@ -78,11 +77,7 @@ struct ipath_portdata { | |||
78 | dma_addr_t port_rcvegr_phys; | 77 | dma_addr_t port_rcvegr_phys; |
79 | /* mmap of hdrq, must fit in 44 bits */ | 78 | /* mmap of hdrq, must fit in 44 bits */ |
80 | dma_addr_t port_rcvhdrq_phys; | 79 | dma_addr_t port_rcvhdrq_phys; |
81 | /* | 80 | dma_addr_t port_rcvhdrqtailaddr_phys; |
82 | * the actual user address that we ipath_mlock'ed, so we can | ||
83 | * ipath_munlock it at close | ||
84 | */ | ||
85 | unsigned long port_rcvhdrtail_uaddr; | ||
86 | /* | 81 | /* |
87 | * number of opens on this instance (0 or 1; ignoring forks, dup, | 82 | * number of opens on this instance (0 or 1; ignoring forks, dup, |
88 | * etc. for now) | 83 | * etc. for now) |
@@ -158,16 +153,10 @@ struct ipath_devdata { | |||
158 | /* base of memory alloced for ipath_kregbase, for free */ | 153 | /* base of memory alloced for ipath_kregbase, for free */ |
159 | u64 *ipath_kregalloc; | 154 | u64 *ipath_kregalloc; |
160 | /* | 155 | /* |
161 | * version of kregbase that doesn't have high bits set (for 32 bit | ||
162 | * programs, so mmap64 44 bit works) | ||
163 | */ | ||
164 | u64 __iomem *ipath_kregvirt; | ||
165 | /* | ||
166 | * virtual address where port0 rcvhdrqtail updated for this unit. | 156 | * virtual address where port0 rcvhdrqtail updated for this unit. |
167 | * only written to by the chip, not the driver. | 157 | * only written to by the chip, not the driver. |
168 | */ | 158 | */ |
169 | volatile __le64 *ipath_hdrqtailptr; | 159 | volatile __le64 *ipath_hdrqtailptr; |
170 | dma_addr_t ipath_dma_addr; | ||
171 | /* ipath_cfgports pointers */ | 160 | /* ipath_cfgports pointers */ |
172 | struct ipath_portdata **ipath_pd; | 161 | struct ipath_portdata **ipath_pd; |
173 | /* sk_buffs used by port 0 eager receive queue */ | 162 | /* sk_buffs used by port 0 eager receive queue */ |
@@ -354,13 +343,17 @@ struct ipath_devdata { | |||
354 | char *ipath_freezemsg; | 343 | char *ipath_freezemsg; |
355 | /* pci access data structure */ | 344 | /* pci access data structure */ |
356 | struct pci_dev *pcidev; | 345 | struct pci_dev *pcidev; |
357 | struct cdev *cdev; | 346 | struct cdev *user_cdev; |
358 | struct class_device *class_dev; | 347 | struct cdev *diag_cdev; |
348 | struct class_device *user_class_dev; | ||
349 | struct class_device *diag_class_dev; | ||
359 | /* timer used to prevent stats overflow, error throttling, etc. */ | 350 | /* timer used to prevent stats overflow, error throttling, etc. */ |
360 | struct timer_list ipath_stats_timer; | 351 | struct timer_list ipath_stats_timer; |
361 | /* check for stale messages in rcv queue */ | 352 | /* check for stale messages in rcv queue */ |
362 | /* only allow one intr at a time. */ | 353 | /* only allow one intr at a time. */ |
363 | unsigned long ipath_rcv_pending; | 354 | unsigned long ipath_rcv_pending; |
355 | void *ipath_dummy_hdrq; /* used after port close */ | ||
356 | dma_addr_t ipath_dummy_hdrq_phys; | ||
364 | 357 | ||
365 | /* | 358 | /* |
366 | * Shadow copies of registers; size indicates read access size. | 359 | * Shadow copies of registers; size indicates read access size. |
@@ -500,8 +493,11 @@ struct ipath_devdata { | |||
500 | u16 ipath_lid; | 493 | u16 ipath_lid; |
501 | /* list of pkeys programmed; 0 if not set */ | 494 | /* list of pkeys programmed; 0 if not set */ |
502 | u16 ipath_pkeys[4]; | 495 | u16 ipath_pkeys[4]; |
503 | /* ASCII serial number, from flash */ | 496 | /* |
504 | u8 ipath_serial[12]; | 497 | * ASCII serial number, from flash, large enough for original |
498 | * all digit strings, and longer QLogic serial number format | ||
499 | */ | ||
500 | u8 ipath_serial[16]; | ||
505 | /* human readable board version */ | 501 | /* human readable board version */ |
506 | u8 ipath_boardversion[80]; | 502 | u8 ipath_boardversion[80]; |
507 | /* chip major rev, from ipath_revision */ | 503 | /* chip major rev, from ipath_revision */ |
@@ -516,12 +512,12 @@ struct ipath_devdata { | |||
516 | u8 ipath_pci_cacheline; | 512 | u8 ipath_pci_cacheline; |
517 | /* LID mask control */ | 513 | /* LID mask control */ |
518 | u8 ipath_lmc; | 514 | u8 ipath_lmc; |
519 | }; | ||
520 | |||
521 | extern volatile __le64 *ipath_port0_rcvhdrtail; | ||
522 | extern dma_addr_t ipath_port0_rcvhdrtail_dma; | ||
523 | 515 | ||
524 | #define IPATH_PORT0_RCVHDRTAIL_SIZE PAGE_SIZE | 516 | /* local link integrity counter */ |
517 | u32 ipath_lli_counter; | ||
518 | /* local link integrity errors */ | ||
519 | u32 ipath_lli_errors; | ||
520 | }; | ||
525 | 521 | ||
526 | extern struct list_head ipath_dev_list; | 522 | extern struct list_head ipath_dev_list; |
527 | extern spinlock_t ipath_devs_lock; | 523 | extern spinlock_t ipath_devs_lock; |
@@ -537,7 +533,7 @@ extern int __ipath_verbs_piobufavail(struct ipath_devdata *); | |||
537 | extern int __ipath_verbs_rcv(struct ipath_devdata *, void *, void *, u32); | 533 | extern int __ipath_verbs_rcv(struct ipath_devdata *, void *, void *, u32); |
538 | 534 | ||
539 | void ipath_layer_add(struct ipath_devdata *); | 535 | void ipath_layer_add(struct ipath_devdata *); |
540 | void ipath_layer_del(struct ipath_devdata *); | 536 | void ipath_layer_remove(struct ipath_devdata *); |
541 | 537 | ||
542 | int ipath_init_chip(struct ipath_devdata *, int); | 538 | int ipath_init_chip(struct ipath_devdata *, int); |
543 | int ipath_enable_wc(struct ipath_devdata *dd); | 539 | int ipath_enable_wc(struct ipath_devdata *dd); |
@@ -551,14 +547,14 @@ int ipath_cdev_init(int minor, char *name, struct file_operations *fops, | |||
551 | void ipath_cdev_cleanup(struct cdev **cdevp, | 547 | void ipath_cdev_cleanup(struct cdev **cdevp, |
552 | struct class_device **class_devp); | 548 | struct class_device **class_devp); |
553 | 549 | ||
554 | int ipath_diag_init(void); | 550 | int ipath_diag_add(struct ipath_devdata *); |
555 | void ipath_diag_cleanup(void); | 551 | void ipath_diag_remove(struct ipath_devdata *); |
556 | void ipath_diag_bringup_link(struct ipath_devdata *); | 552 | void ipath_diag_bringup_link(struct ipath_devdata *); |
557 | 553 | ||
558 | extern wait_queue_head_t ipath_sma_state_wait; | 554 | extern wait_queue_head_t ipath_sma_state_wait; |
559 | 555 | ||
560 | int ipath_user_add(struct ipath_devdata *dd); | 556 | int ipath_user_add(struct ipath_devdata *dd); |
561 | void ipath_user_del(struct ipath_devdata *dd); | 557 | void ipath_user_remove(struct ipath_devdata *dd); |
562 | 558 | ||
563 | struct sk_buff *ipath_alloc_skb(struct ipath_devdata *dd, gfp_t); | 559 | struct sk_buff *ipath_alloc_skb(struct ipath_devdata *dd, gfp_t); |
564 | 560 | ||
@@ -582,7 +578,7 @@ void ipath_disarm_piobufs(struct ipath_devdata *, unsigned first, | |||
582 | unsigned cnt); | 578 | unsigned cnt); |
583 | 579 | ||
584 | int ipath_create_rcvhdrq(struct ipath_devdata *, struct ipath_portdata *); | 580 | int ipath_create_rcvhdrq(struct ipath_devdata *, struct ipath_portdata *); |
585 | void ipath_free_pddata(struct ipath_devdata *, u32, int); | 581 | void ipath_free_pddata(struct ipath_devdata *, struct ipath_portdata *); |
586 | 582 | ||
587 | int ipath_parse_ushort(const char *str, unsigned short *valp); | 583 | int ipath_parse_ushort(const char *str, unsigned short *valp); |
588 | 584 | ||
@@ -720,13 +716,8 @@ u64 ipath_read_kreg64_port(const struct ipath_devdata *, ipath_kreg, | |||
720 | * @port: port number | 716 | * @port: port number |
721 | * | 717 | * |
722 | * Return the contents of a register that is virtualized to be per port. | 718 | * Return the contents of a register that is virtualized to be per port. |
723 | * Prints a debug message and returns -1 on errors (not distinguishable from | 719 | * Returns -1 on errors (not distinguishable from valid contents at |
724 | * valid contents at runtime; we may add a separate error variable at some | 720 | * runtime; we may add a separate error variable at some point). |
725 | * point). | ||
726 | * | ||
727 | * This is normally not used by the kernel, but may be for debugging, and | ||
728 | * has a different implementation than user mode, which is why it's not in | ||
729 | * _common.h. | ||
730 | */ | 721 | */ |
731 | static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, | 722 | static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, |
732 | ipath_ureg regno, int port) | 723 | ipath_ureg regno, int port) |
@@ -842,9 +833,10 @@ extern struct mutex ipath_mutex; | |||
842 | 833 | ||
843 | #define IPATH_DRV_NAME "ipath_core" | 834 | #define IPATH_DRV_NAME "ipath_core" |
844 | #define IPATH_MAJOR 233 | 835 | #define IPATH_MAJOR 233 |
836 | #define IPATH_USER_MINOR_BASE 0 | ||
845 | #define IPATH_SMA_MINOR 128 | 837 | #define IPATH_SMA_MINOR 128 |
846 | #define IPATH_DIAG_MINOR 129 | 838 | #define IPATH_DIAG_MINOR_BASE 129 |
847 | #define IPATH_NMINORS 130 | 839 | #define IPATH_NMINORS 255 |
848 | 840 | ||
849 | #define ipath_dev_err(dd,fmt,...) \ | 841 | #define ipath_dev_err(dd,fmt,...) \ |
850 | do { \ | 842 | do { \ |