Commit ac2ae4c9 authored by Roland Dreier's avatar Roland Dreier

IB/ipath: Make more names static

Make symbols that are only used in a single source file static.
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 64cb9c6a
...@@ -365,15 +365,3 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data, ...@@ -365,15 +365,3 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data,
bail: bail:
return ret; return ret;
} }
void ipath_diag_bringup_link(struct ipath_devdata *dd)
{
if (diag_set_link || (dd->ipath_flags & IPATH_LINKACTIVE))
return;
diag_set_link = 1;
ipath_cdbg(VERBOSE, "Trying to set to set link active for "
"diag pkt\n");
ipath_layer_set_linkstate(dd, IPATH_IB_LINKARM);
ipath_layer_set_linkstate(dd, IPATH_IB_LINKACTIVE);
}
...@@ -1729,7 +1729,7 @@ void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq) ...@@ -1729,7 +1729,7 @@ void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq)
} }
} }
int __init infinipath_init(void) static int __init infinipath_init(void)
{ {
int ret; int ret;
......
...@@ -528,7 +528,6 @@ extern spinlock_t ipath_devs_lock; ...@@ -528,7 +528,6 @@ extern spinlock_t ipath_devs_lock;
extern struct ipath_devdata *ipath_lookup(int unit); extern struct ipath_devdata *ipath_lookup(int unit);
extern u16 ipath_layer_rcv_opcode; extern u16 ipath_layer_rcv_opcode;
extern int ipath_verbs_registered;
extern int __ipath_layer_intr(struct ipath_devdata *, u32); extern int __ipath_layer_intr(struct ipath_devdata *, u32);
extern int ipath_layer_intr(struct ipath_devdata *, u32); extern int ipath_layer_intr(struct ipath_devdata *, u32);
extern int __ipath_layer_rcv(struct ipath_devdata *, void *, extern int __ipath_layer_rcv(struct ipath_devdata *, void *,
......
...@@ -52,7 +52,7 @@ static int (*layer_rcv)(void *, void *, struct sk_buff *); ...@@ -52,7 +52,7 @@ static int (*layer_rcv)(void *, void *, struct sk_buff *);
static int (*layer_rcv_lid)(void *, void *); static int (*layer_rcv_lid)(void *, void *);
static int (*verbs_piobufavail)(void *); static int (*verbs_piobufavail)(void *);
static void (*verbs_rcv)(void *, void *, void *, u32); static void (*verbs_rcv)(void *, void *, void *, u32);
int ipath_verbs_registered; static int ipath_verbs_registered;
static void *(*layer_add_one)(int, struct ipath_devdata *); static void *(*layer_add_one)(int, struct ipath_devdata *);
static void (*layer_remove_one)(void *); static void (*layer_remove_one)(void *);
......
...@@ -305,7 +305,7 @@ static const struct ipath_cregs ipath_pe_cregs = { ...@@ -305,7 +305,7 @@ static const struct ipath_cregs ipath_pe_cregs = {
* we'll print them and continue. We reuse the same message buffer as * we'll print them and continue. We reuse the same message buffer as
* ipath_handle_errors() to avoid excessive stack usage. * ipath_handle_errors() to avoid excessive stack usage.
*/ */
void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg, static void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
size_t msgl) size_t msgl)
{ {
ipath_err_t hwerrs; ipath_err_t hwerrs;
...@@ -552,7 +552,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name, ...@@ -552,7 +552,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
* freeze mode), and enable hardware errors as errors (along with * freeze mode), and enable hardware errors as errors (along with
* everything else) in errormask * everything else) in errormask
*/ */
void ipath_pe_init_hwerrors(struct ipath_devdata *dd) static void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
{ {
ipath_err_t val; ipath_err_t val;
u64 extsval; u64 extsval;
...@@ -577,7 +577,7 @@ void ipath_pe_init_hwerrors(struct ipath_devdata *dd) ...@@ -577,7 +577,7 @@ void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
* ipath_pe_bringup_serdes - bring up the serdes * ipath_pe_bringup_serdes - bring up the serdes
* @dd: the infinipath device * @dd: the infinipath device
*/ */
int ipath_pe_bringup_serdes(struct ipath_devdata *dd) static int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
{ {
u64 val, tmp, config1; u64 val, tmp, config1;
int ret = 0, change = 0; int ret = 0, change = 0;
...@@ -694,7 +694,7 @@ int ipath_pe_bringup_serdes(struct ipath_devdata *dd) ...@@ -694,7 +694,7 @@ int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
* @dd: the infinipath device * @dd: the infinipath device
* Called when driver is being unloaded * Called when driver is being unloaded
*/ */
void ipath_pe_quiet_serdes(struct ipath_devdata *dd) static void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
{ {
u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0); u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0);
......
...@@ -188,7 +188,7 @@ static void free_qpn(struct ipath_qp_table *qpt, u32 qpn) ...@@ -188,7 +188,7 @@ static void free_qpn(struct ipath_qp_table *qpt, u32 qpn)
* Allocate the next available QPN and put the QP into the hash table. * Allocate the next available QPN and put the QP into the hash table.
* The hash table holds a reference to the QP. * The hash table holds a reference to the QP.
*/ */
int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp, static int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
enum ib_qp_type type) enum ib_qp_type type)
{ {
unsigned long flags; unsigned long flags;
...@@ -232,7 +232,7 @@ int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp, ...@@ -232,7 +232,7 @@ int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
* Remove the QP from the table so it can't be found asynchronously by * Remove the QP from the table so it can't be found asynchronously by
* the receive interrupt routine. * the receive interrupt routine.
*/ */
void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp) static void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
{ {
struct ipath_qp *q, **qpp; struct ipath_qp *q, **qpp;
unsigned long flags; unsigned long flags;
...@@ -357,6 +357,65 @@ static void ipath_reset_qp(struct ipath_qp *qp) ...@@ -357,6 +357,65 @@ static void ipath_reset_qp(struct ipath_qp *qp)
qp->r_reuse_sge = 0; qp->r_reuse_sge = 0;
} }
/**
* ipath_error_qp - put a QP into an error state
* @qp: the QP to put into an error state
*
* Flushes both send and receive work queues.
* QP r_rq.lock and s_lock should be held.
*/
static void ipath_error_qp(struct ipath_qp *qp)
{
struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
struct ib_wc wc;
_VERBS_INFO("QP%d/%d in error state\n",
qp->ibqp.qp_num, qp->remote_qpn);
spin_lock(&dev->pending_lock);
/* XXX What if its already removed by the timeout code? */
if (qp->timerwait.next != LIST_POISON1)
list_del(&qp->timerwait);
if (qp->piowait.next != LIST_POISON1)
list_del(&qp->piowait);
spin_unlock(&dev->pending_lock);
wc.status = IB_WC_WR_FLUSH_ERR;
wc.vendor_err = 0;
wc.byte_len = 0;
wc.imm_data = 0;
wc.qp_num = qp->ibqp.qp_num;
wc.src_qp = 0;
wc.wc_flags = 0;
wc.pkey_index = 0;
wc.slid = 0;
wc.sl = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;
while (qp->s_last != qp->s_head) {
struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
wc.wr_id = wqe->wr.wr_id;
wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
if (++qp->s_last >= qp->s_size)
qp->s_last = 0;
ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
}
qp->s_cur = qp->s_tail = qp->s_head;
qp->s_hdrwords = 0;
qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
wc.opcode = IB_WC_RECV;
while (qp->r_rq.tail != qp->r_rq.head) {
wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
if (++qp->r_rq.tail >= qp->r_rq.size)
qp->r_rq.tail = 0;
ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
}
}
/** /**
* ipath_modify_qp - modify the attributes of a queue pair * ipath_modify_qp - modify the attributes of a queue pair
* @ibqp: the queue pair who's attributes we're modifying * @ibqp: the queue pair who's attributes we're modifying
...@@ -820,65 +879,6 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) ...@@ -820,65 +879,6 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
qp->state = IB_QPS_SQE; qp->state = IB_QPS_SQE;
} }
/**
* ipath_error_qp - put a QP into an error state
* @qp: the QP to put into an error state
*
* Flushes both send and receive work queues.
* QP r_rq.lock and s_lock should be held.
*/
void ipath_error_qp(struct ipath_qp *qp)
{
struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
struct ib_wc wc;
_VERBS_INFO("QP%d/%d in error state\n",
qp->ibqp.qp_num, qp->remote_qpn);
spin_lock(&dev->pending_lock);
/* XXX What if its already removed by the timeout code? */
if (qp->timerwait.next != LIST_POISON1)
list_del(&qp->timerwait);
if (qp->piowait.next != LIST_POISON1)
list_del(&qp->piowait);
spin_unlock(&dev->pending_lock);
wc.status = IB_WC_WR_FLUSH_ERR;
wc.vendor_err = 0;
wc.byte_len = 0;
wc.imm_data = 0;
wc.qp_num = qp->ibqp.qp_num;
wc.src_qp = 0;
wc.wc_flags = 0;
wc.pkey_index = 0;
wc.slid = 0;
wc.sl = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;
while (qp->s_last != qp->s_head) {
struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
wc.wr_id = wqe->wr.wr_id;
wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
if (++qp->s_last >= qp->s_size)
qp->s_last = 0;
ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
}
qp->s_cur = qp->s_tail = qp->s_head;
qp->s_hdrwords = 0;
qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;
wc.opcode = IB_WC_RECV;
while (qp->r_rq.tail != qp->r_rq.head) {
wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
if (++qp->r_rq.tail >= qp->r_rq.size)
qp->r_rq.tail = 0;
ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
}
}
/** /**
* ipath_get_credit - flush the send work queue of a QP * ipath_get_credit - flush the send work queue of a QP
* @qp: the qp who's send work queue to flush * @qp: the qp who's send work queue to flush
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* This is called from ipath_post_ud_send() to forward a WQE addressed * This is called from ipath_post_ud_send() to forward a WQE addressed
* to the same HCA. * to the same HCA.
*/ */
void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss, static void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss,
u32 length, struct ib_send_wr *wr, struct ib_wc *wc) u32 length, struct ib_send_wr *wr, struct ib_wc *wc)
{ {
struct ipath_ibdev *dev = to_idev(sqp->ibqp.device); struct ipath_ibdev *dev = to_idev(sqp->ibqp.device);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/* Not static, because we don't want the compiler removing it */ /* Not static, because we don't want the compiler removing it */
const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR; const char ipath_verbs_version[] = "ipath_verbs " IPATH_IDSTR;
unsigned int ib_ipath_qp_table_size = 251; static unsigned int ib_ipath_qp_table_size = 251;
module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO); module_param_named(qp_table_size, ib_ipath_qp_table_size, uint, S_IRUGO);
MODULE_PARM_DESC(qp_table_size, "QP table size"); MODULE_PARM_DESC(qp_table_size, "QP table size");
...@@ -87,7 +87,7 @@ const enum ib_wc_opcode ib_ipath_wc_opcode[] = { ...@@ -87,7 +87,7 @@ const enum ib_wc_opcode ib_ipath_wc_opcode[] = {
/* /*
* System image GUID. * System image GUID.
*/ */
__be64 sys_image_guid; static __be64 sys_image_guid;
/** /**
* ipath_copy_sge - copy data to SGE memory * ipath_copy_sge - copy data to SGE memory
...@@ -1110,7 +1110,7 @@ static void ipath_unregister_ib_device(void *arg) ...@@ -1110,7 +1110,7 @@ static void ipath_unregister_ib_device(void *arg)
ib_dealloc_device(ibdev); ib_dealloc_device(ibdev);
} }
int __init ipath_verbs_init(void) static int __init ipath_verbs_init(void)
{ {
return ipath_verbs_register(ipath_register_ib_device, return ipath_verbs_register(ipath_register_ib_device,
ipath_unregister_ib_device, ipath_unregister_ib_device,
...@@ -1118,7 +1118,7 @@ int __init ipath_verbs_init(void) ...@@ -1118,7 +1118,7 @@ int __init ipath_verbs_init(void)
ipath_ib_timer); ipath_ib_timer);
} }
void __exit ipath_verbs_cleanup(void) static void __exit ipath_verbs_cleanup(void)
{ {
ipath_verbs_unregister(); ipath_verbs_unregister();
} }
......
...@@ -577,8 +577,6 @@ int ipath_init_qp_table(struct ipath_ibdev *idev, int size); ...@@ -577,8 +577,6 @@ int ipath_init_qp_table(struct ipath_ibdev *idev, int size);
void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc); void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc);
void ipath_error_qp(struct ipath_qp *qp);
void ipath_get_credit(struct ipath_qp *qp, u32 aeth); void ipath_get_credit(struct ipath_qp *qp, u32 aeth);
void ipath_do_rc_send(unsigned long data); void ipath_do_rc_send(unsigned long data);
...@@ -607,9 +605,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, ...@@ -607,9 +605,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc); void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc);
void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss,
u32 length, struct ib_send_wr *wr, struct ib_wc *wc);
int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr); int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr);
void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment