From a6eb23b528a0042a3dd002387d0648df218935a0 Mon Sep 17 00:00:00 2001 From: kmacy Date: Mon, 21 Jul 2008 01:23:19 +0000 Subject: [PATCH] remove cxgb local definitions of socket accessor functions --- sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c | 27 ++-- sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c | 201 ------------------------ sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.h | 40 ----- 3 files changed, 18 insertions(+), 250 deletions(-) diff --git a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c index 3ca0a52cb057..5bf63fae80b6 100644 --- a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c +++ b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c @@ -414,13 +414,18 @@ t3_push_frames(struct socket *so, int req_completion) snd->sb_sndptroff += bytes; total_bytes += bytes; toep->tp_write_seq += bytes; - CTR6(KTR_TOM, "t3_push_frames: wr_avail=%d mbuf_wrs[%d]=%d tail=%p sndptr=%p sndptroff=%d", - toep->tp_wr_avail, count, mbuf_wrs[count], tail, snd->sb_sndptr, snd->sb_sndptroff); + CTR6(KTR_TOM, "t3_push_frames: wr_avail=%d mbuf_wrs[%d]=%d" + " tail=%p sndptr=%p sndptroff=%d", + toep->tp_wr_avail, count, mbuf_wrs[count], + tail, snd->sb_sndptr, snd->sb_sndptroff); if (tail) - CTR4(KTR_TOM, "t3_push_frames: total_bytes=%d tp_m_last=%p tailbuf=%p snd_una=0x%08x", - total_bytes, toep->tp_m_last, tail->m_data, tp->snd_una); + CTR4(KTR_TOM, "t3_push_frames: total_bytes=%d" + " tp_m_last=%p tailbuf=%p snd_una=0x%08x", + total_bytes, toep->tp_m_last, tail->m_data, + tp->snd_una); else - CTR3(KTR_TOM, "t3_push_frames: total_bytes=%d tp_m_last=%p snd_una=0x%08x", + CTR3(KTR_TOM, "t3_push_frames: total_bytes=%d" + " tp_m_last=%p snd_una=0x%08x", total_bytes, toep->tp_m_last, tp->snd_una); @@ -432,14 +437,18 @@ t3_push_frames(struct socket *so, int req_completion) while (i < count && m_get_sgllen(m0)) { if ((count - i) >= 3) { CTR6(KTR_TOM, - "t3_push_frames: pa=0x%zx len=%d pa=0x%zx len=%d pa=0x%zx len=%d", - segs[i].ds_addr, segs[i].ds_len, segs[i + 1].ds_addr, segs[i + 1].ds_len, + "t3_push_frames: pa=0x%zx len=%d pa=0x%zx" + " len=%d pa=0x%zx len=%d", + segs[i].ds_addr, segs[i].ds_len, + segs[i + 1].ds_addr, segs[i + 1].ds_len, segs[i + 2].ds_addr, segs[i + 2].ds_len); i += 3; } else if ((count - i) == 2) { CTR4(KTR_TOM, - "t3_push_frames: pa=0x%zx len=%d pa=0x%zx len=%d", - segs[i].ds_addr, segs[i].ds_len, segs[i + 1].ds_addr, segs[i + 1].ds_len); + "t3_push_frames: pa=0x%zx len=%d pa=0x%zx" + " len=%d", + segs[i].ds_addr, segs[i].ds_len, + segs[i + 1].ds_addr, segs[i + 1].ds_len); i += 2; } else { CTR2(KTR_TOM, "t3_push_frames: pa=0x%zx len=%d", diff --git a/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c b/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c index 1d9684291e16..edc9fea7abd5 100644 --- a/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c +++ b/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.c @@ -117,207 +117,6 @@ tcp_offload_drop(struct tcpcb *tp, int error) return (tp); } -void -inp_apply_all(void (*func)(struct inpcb *, void *), void *arg) -{ - struct inpcb *inp; - - INP_INFO_RLOCK(&tcbinfo); - LIST_FOREACH(inp, tcbinfo.ipi_listhead, inp_list) { - INP_WLOCK(inp); - func(inp, arg); - INP_WUNLOCK(inp); - } - INP_INFO_RUNLOCK(&tcbinfo); -} - -struct socket * -inp_inpcbtosocket(struct inpcb *inp) -{ - - INP_WLOCK_ASSERT(inp); - return (inp->inp_socket); -} - -struct tcpcb * -inp_inpcbtotcpcb(struct inpcb *inp) -{ - - INP_WLOCK_ASSERT(inp); - return ((struct tcpcb *)inp->inp_ppcb); -} - -int -inp_ip_tos_get(const struct inpcb *inp) -{ - - return (inp->inp_ip_tos); -} - -void -inp_ip_tos_set(struct inpcb *inp, int val) -{ - - inp->inp_ip_tos = val; -} - -void -inp_4tuple_get(const struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp) -{ - - memcpy(laddr, &inp->inp_laddr, 4); - memcpy(faddr, &inp->inp_faddr, 4); - - *lp = inp->inp_lport; - *fp = inp->inp_fport; -} - -void -so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg) -{ - - TAILQ_FOREACH(so, &so->so_comp, so_list) - func(so, arg); -} - -struct tcpcb * -so_sototcpcb(struct socket *so) -{ - - return (sototcpcb(so)); -} - -struct inpcb * -so_sotoinpcb(struct socket *so) -{ - - return (sotoinpcb(so)); -} - -struct sockbuf * -so_sockbuf_rcv(struct socket *so) -{ - - return (&so->so_rcv); -} - -struct sockbuf * -so_sockbuf_snd(struct socket *so) -{ - - return (&so->so_snd); -} - -int -so_state_get(const struct socket *so) -{ - - return (so->so_state); -} - -void -so_state_set(struct socket *so, int val) -{ - - so->so_state = val; -} - -int -so_options_get(const struct socket *so) -{ - - return (so->so_options); -} - -void -so_options_set(struct socket *so, int val) -{ - - so->so_options = val; -} - -int -so_error_get(const struct socket *so) -{ - - return (so->so_error); -} - -void -so_error_set(struct socket *so, int val) -{ - - so->so_error = val; -} - -int -so_linger_get(const struct socket *so) -{ - - return (so->so_linger); -} - -void -so_linger_set(struct socket *so, int val) -{ - - so->so_linger = val; -} - -struct protosw * -so_protosw_get(const struct socket *so) -{ - - return (so->so_proto); -} - -void -so_protosw_set(struct socket *so, struct protosw *val) -{ - - so->so_proto = val; -} - -void -so_sorwakeup(struct socket *so) -{ - - sorwakeup(so); -} - -void -so_sowwakeup(struct socket *so) -{ - - sowwakeup(so); -} - -void -so_sorwakeup_locked(struct socket *so) -{ - - sorwakeup_locked(so); -} - -void -so_sowwakeup_locked(struct socket *so) -{ - - sowwakeup_locked(so); -} - -void -so_lock(struct socket *so) -{ - SOCK_LOCK(so); -} - -void -so_unlock(struct socket *so) -{ - SOCK_UNLOCK(so); -} - void sockbuf_lock(struct sockbuf *sb) { diff --git a/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.h b/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.h index 66dff938f1e3..3e833b0b59c6 100644 --- a/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.h +++ b/sys/dev/cxgb/ulp/tom/cxgb_tcp_offload.h @@ -12,46 +12,6 @@ void tcp_offload_twstart_disconnect(struct tcpcb *tp); struct tcpcb *tcp_offload_close(struct tcpcb *tp); struct tcpcb *tcp_offload_drop(struct tcpcb *tp, int error); -void inp_apply_all(void (*func)(struct inpcb *, void *), void *arg); -struct socket *inp_inpcbtosocket(struct inpcb *inp); -struct tcpcb *inp_inpcbtotcpcb(struct inpcb *inp); - -int inp_ip_tos_get(const struct inpcb *); -void inp_ip_tos_set(struct inpcb *, int); -void inp_4tuple_get(const struct inpcb *inp, uint32_t *, uint16_t *, uint32_t *, uint16_t *); - -struct tcpcb *so_sototcpcb(struct socket *so); -struct inpcb *so_sotoinpcb(struct socket *so); -struct sockbuf *so_sockbuf_snd(struct socket *); -struct sockbuf *so_sockbuf_rcv(struct socket *); - -int so_state_get(const struct socket *); -void so_state_set(struct socket *, int); - -int so_options_get(const struct socket *); -void so_options_set(struct socket *, int); - -int so_error_get(const struct socket *); -void so_error_set(struct socket *, int); - -int so_linger_get(const struct socket *); -void so_linger_set(struct socket *, int); - -struct protosw *so_protosw_get(const struct socket *); -void so_protosw_set(struct socket *, struct protosw *); - -void so_sorwakeup_locked(struct socket *so); -void so_sowwakeup_locked(struct socket *so); - -void so_sorwakeup(struct socket *so); -void so_sowwakeup(struct socket *so); - -void so_lock(struct socket *so); -void so_unlock(struct socket *so); - -void so_listeners_apply_all(struct socket *so, void (*func)(struct socket *, void *), void *arg); - - void sockbuf_lock(struct sockbuf *); void sockbuf_lock_assert(struct sockbuf *); void sockbuf_unlock(struct sockbuf *);