Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_tom.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
#include "common/t4_regs.h" | #include "common/t4_regs.h" | ||||
#include "common/t4_regs_values.h" | #include "common/t4_regs_values.h" | ||||
#include "common/t4_tcb.h" | #include "common/t4_tcb.h" | ||||
#include "t4_clip.h" | #include "t4_clip.h" | ||||
#include "tom/t4_tom_l2t.h" | #include "tom/t4_tom_l2t.h" | ||||
#include "tom/t4_tom.h" | #include "tom/t4_tom.h" | ||||
#include "tom/t4_tls.h" | #include "tom/t4_tls.h" | ||||
static struct protosw *tcp_protosw; | |||||
static struct protosw toe_protosw; | static struct protosw toe_protosw; | ||||
static struct pr_usrreqs toe_usrreqs; | |||||
static struct protosw *tcp6_protosw; | |||||
static struct protosw toe6_protosw; | static struct protosw toe6_protosw; | ||||
static struct pr_usrreqs toe6_usrreqs; | |||||
/* Module ops */ | /* Module ops */ | ||||
static int t4_tom_mod_load(void); | static int t4_tom_mod_load(void); | ||||
static int t4_tom_mod_unload(void); | static int t4_tom_mod_unload(void); | ||||
static int t4_tom_modevent(module_t, int, void *); | static int t4_tom_modevent(module_t, int, void *); | ||||
/* ULD ops and helpers */ | /* ULD ops and helpers */ | ||||
static int t4_tom_activate(struct adapter *); | static int t4_tom_activate(struct adapter *); | ||||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | offload_socket(struct socket *so, struct toepcb *toep) | ||||
TAILQ_INSERT_HEAD(&td->toep_list, toep, link); | TAILQ_INSERT_HEAD(&td->toep_list, toep, link); | ||||
mtx_unlock(&td->toep_list_lock); | mtx_unlock(&td->toep_list_lock); | ||||
} | } | ||||
void | void | ||||
restore_so_proto(struct socket *so, bool v6) | restore_so_proto(struct socket *so, bool v6) | ||||
{ | { | ||||
if (v6) | if (v6) | ||||
so->so_proto = tcp6_protosw; | so->so_proto = &tcp6_protosw; | ||||
else | else | ||||
so->so_proto = tcp_protosw; | so->so_proto = &tcp_protosw; | ||||
} | } | ||||
/* This is _not_ the normal way to "unoffload" a socket. */ | /* This is _not_ the normal way to "unoffload" a socket. */ | ||||
void | void | ||||
undo_offload_socket(struct socket *so) | undo_offload_socket(struct socket *so) | ||||
{ | { | ||||
struct inpcb *inp = sotoinpcb(so); | struct inpcb *inp = sotoinpcb(so); | ||||
struct tcpcb *tp = intotcpcb(inp); | struct tcpcb *tp = intotcpcb(inp); | ||||
▲ Show 20 Lines • Show All 1,736 Lines • ▼ Show 20 Lines | t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl2, | ||||
CPL_COOKIE_TOM); | CPL_COOKIE_TOM); | ||||
t4_init_connect_cpl_handlers(); | t4_init_connect_cpl_handlers(); | ||||
t4_init_listen_cpl_handlers(); | t4_init_listen_cpl_handlers(); | ||||
t4_init_cpl_io_handlers(); | t4_init_cpl_io_handlers(); | ||||
t4_ddp_mod_load(); | t4_ddp_mod_load(); | ||||
t4_tls_mod_load(); | t4_tls_mod_load(); | ||||
tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM); | bcopy(&tcp_protosw, &toe_protosw, sizeof(toe_protosw)); | ||||
if (tcp_protosw == NULL) | toe_protosw.pr_aio_queue = t4_aio_queue_tom; | ||||
return (ENOPROTOOPT); | |||||
bcopy(tcp_protosw, &toe_protosw, sizeof(toe_protosw)); | |||||
bcopy(tcp_protosw->pr_usrreqs, &toe_usrreqs, sizeof(toe_usrreqs)); | |||||
toe_usrreqs.pru_aio_queue = t4_aio_queue_tom; | |||||
toe_protosw.pr_usrreqs = &toe_usrreqs; | |||||
tcp6_protosw = pffindproto(PF_INET6, IPPROTO_TCP, SOCK_STREAM); | bcopy(&tcp6_protosw, &toe6_protosw, sizeof(toe6_protosw)); | ||||
if (tcp6_protosw == NULL) | toe6_protosw.pr_aio_queue = t4_aio_queue_tom; | ||||
return (ENOPROTOOPT); | |||||
bcopy(tcp6_protosw, &toe6_protosw, sizeof(toe6_protosw)); | |||||
bcopy(tcp6_protosw->pr_usrreqs, &toe6_usrreqs, sizeof(toe6_usrreqs)); | |||||
toe6_usrreqs.pru_aio_queue = t4_aio_queue_tom; | |||||
toe6_protosw.pr_usrreqs = &toe6_usrreqs; | |||||
return (t4_register_uld(&tom_uld_info)); | return (t4_register_uld(&tom_uld_info)); | ||||
} | } | ||||
static void | static void | ||||
tom_uninit(struct adapter *sc, void *arg __unused) | tom_uninit(struct adapter *sc, void *arg __unused) | ||||
{ | { | ||||
if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4tomun")) | if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4tomun")) | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |