Lines Matching refs:csk
310 static inline void cxgbi_sock_set_flag(struct cxgbi_sock *csk, in cxgbi_sock_set_flag() argument
313 __set_bit(flag, &csk->flags); in cxgbi_sock_set_flag()
316 csk, csk->state, csk->flags, flag); in cxgbi_sock_set_flag()
319 static inline void cxgbi_sock_clear_flag(struct cxgbi_sock *csk, in cxgbi_sock_clear_flag() argument
322 __clear_bit(flag, &csk->flags); in cxgbi_sock_clear_flag()
325 csk, csk->state, csk->flags, flag); in cxgbi_sock_clear_flag()
328 static inline int cxgbi_sock_flag(struct cxgbi_sock *csk, in cxgbi_sock_flag() argument
331 if (csk == NULL) in cxgbi_sock_flag()
333 return test_bit(flag, &csk->flags); in cxgbi_sock_flag()
336 static inline void cxgbi_sock_set_state(struct cxgbi_sock *csk, int state) in cxgbi_sock_set_state() argument
340 csk, csk->state, csk->flags, state); in cxgbi_sock_set_state()
341 csk->state = state; in cxgbi_sock_set_state()
346 struct cxgbi_sock *csk = container_of(kref, in cxgbi_sock_free() local
349 if (csk) { in cxgbi_sock_free()
352 csk, csk->state, csk->flags); in cxgbi_sock_free()
353 kfree(csk); in cxgbi_sock_free()
357 static inline void __cxgbi_sock_put(const char *fn, struct cxgbi_sock *csk) in __cxgbi_sock_put() argument
361 fn, csk, atomic_read(&csk->refcnt.refcount)); in __cxgbi_sock_put()
362 kref_put(&csk->refcnt, cxgbi_sock_free); in __cxgbi_sock_put()
364 #define cxgbi_sock_put(csk) __cxgbi_sock_put(__func__, csk) argument
366 static inline void __cxgbi_sock_get(const char *fn, struct cxgbi_sock *csk) in __cxgbi_sock_get() argument
370 fn, csk, atomic_read(&csk->refcnt.refcount)); in __cxgbi_sock_get()
371 kref_get(&csk->refcnt); in __cxgbi_sock_get()
373 #define cxgbi_sock_get(csk) __cxgbi_sock_get(__func__, csk) argument
375 static inline int cxgbi_sock_is_closing(struct cxgbi_sock *csk) in cxgbi_sock_is_closing() argument
377 return csk->state >= CTP_ACTIVE_CLOSE; in cxgbi_sock_is_closing()
380 static inline int cxgbi_sock_is_established(struct cxgbi_sock *csk) in cxgbi_sock_is_established() argument
382 return csk->state == CTP_ESTABLISHED; in cxgbi_sock_is_established()
385 static inline void cxgbi_sock_purge_write_queue(struct cxgbi_sock *csk) in cxgbi_sock_purge_write_queue() argument
389 while ((skb = __skb_dequeue(&csk->write_queue))) in cxgbi_sock_purge_write_queue()
423 static inline void cxgbi_sock_reset_wr_list(struct cxgbi_sock *csk) in cxgbi_sock_reset_wr_list() argument
425 csk->wr_pending_head = csk->wr_pending_tail = NULL; in cxgbi_sock_reset_wr_list()
428 static inline void cxgbi_sock_enqueue_wr(struct cxgbi_sock *csk, in cxgbi_sock_enqueue_wr() argument
440 if (!csk->wr_pending_head) in cxgbi_sock_enqueue_wr()
441 csk->wr_pending_head = skb; in cxgbi_sock_enqueue_wr()
443 cxgbi_skcb_tx_wr_next(csk->wr_pending_tail) = skb; in cxgbi_sock_enqueue_wr()
444 csk->wr_pending_tail = skb; in cxgbi_sock_enqueue_wr()
447 static inline int cxgbi_sock_count_pending_wrs(const struct cxgbi_sock *csk) in cxgbi_sock_count_pending_wrs() argument
450 const struct sk_buff *skb = csk->wr_pending_head; in cxgbi_sock_count_pending_wrs()
459 static inline struct sk_buff *cxgbi_sock_peek_wr(const struct cxgbi_sock *csk) in cxgbi_sock_peek_wr() argument
461 return csk->wr_pending_head; in cxgbi_sock_peek_wr()
464 static inline struct sk_buff *cxgbi_sock_dequeue_wr(struct cxgbi_sock *csk) in cxgbi_sock_dequeue_wr() argument
466 struct sk_buff *skb = csk->wr_pending_head; in cxgbi_sock_dequeue_wr()
469 csk->wr_pending_head = cxgbi_skcb_tx_wr_next(skb); in cxgbi_sock_dequeue_wr()
571 struct cxgbi_sock *csk; member