10
10
#ifndef __QETH_CORE_H__
11
11
#define __QETH_CORE_H__
12
12
13
+ #include <linux/completion.h>
13
14
#include <linux/if.h>
14
15
#include <linux/if_arp.h>
15
16
#include <linux/etherdevice.h>
21
22
#include <linux/hashtable.h>
22
23
#include <linux/ip.h>
23
24
#include <linux/refcount.h>
25
+ #include <linux/wait.h>
24
26
#include <linux/workqueue.h>
25
27
26
28
#include <net/ipv6.h>
@@ -538,7 +540,6 @@ struct qeth_qdio_info {
538
540
enum qeth_channel_states {
539
541
CH_STATE_UP ,
540
542
CH_STATE_DOWN ,
541
- CH_STATE_ACTIVATING ,
542
543
CH_STATE_HALTED ,
543
544
CH_STATE_STOPPED ,
544
545
CH_STATE_RCD ,
@@ -585,7 +586,10 @@ struct qeth_cmd_buffer {
585
586
enum qeth_cmd_buffer_state state ;
586
587
struct qeth_channel * channel ;
587
588
struct qeth_reply * reply ;
589
+ long timeout ;
588
590
unsigned char * data ;
591
+ void (* finalize )(struct qeth_card * card , struct qeth_cmd_buffer * iob ,
592
+ unsigned int length );
589
593
void (* callback )(struct qeth_card * card , struct qeth_channel * channel ,
590
594
struct qeth_cmd_buffer * iob );
591
595
};
@@ -610,6 +614,11 @@ struct qeth_channel {
610
614
int io_buf_no ;
611
615
};
612
616
617
+ static inline bool qeth_trylock_channel (struct qeth_channel * channel )
618
+ {
619
+ return atomic_cmpxchg (& channel -> irq_pending , 0 , 1 ) == 0 ;
620
+ }
621
+
613
622
/**
614
623
* OSA card related definitions
615
624
*/
@@ -636,12 +645,11 @@ struct qeth_seqno {
636
645
637
646
struct qeth_reply {
638
647
struct list_head list ;
639
- wait_queue_head_t wait_q ;
648
+ struct completion received ;
640
649
int (* callback )(struct qeth_card * , struct qeth_reply * ,
641
650
unsigned long );
642
651
u32 seqno ;
643
652
unsigned long offset ;
644
- atomic_t received ;
645
653
int rc ;
646
654
void * param ;
647
655
refcount_t refcnt ;
@@ -774,18 +782,19 @@ struct qeth_card {
774
782
struct qeth_card_options options ;
775
783
776
784
struct workqueue_struct * event_wq ;
785
+ struct workqueue_struct * cmd_wq ;
777
786
wait_queue_head_t wait_q ;
778
- spinlock_t mclock ;
779
787
unsigned long active_vlans [BITS_TO_LONGS (VLAN_N_VID )];
780
788
DECLARE_HASHTABLE (mac_htable , 4 );
781
789
DECLARE_HASHTABLE (ip_htable , 4 );
790
+ struct mutex ip_lock ;
782
791
DECLARE_HASHTABLE (ip_mc_htable , 4 );
792
+ struct work_struct rx_mode_work ;
783
793
struct work_struct kernel_thread_starter ;
784
794
spinlock_t thread_mask_lock ;
785
795
unsigned long thread_start_mask ;
786
796
unsigned long thread_allowed_mask ;
787
797
unsigned long thread_running_mask ;
788
- spinlock_t ip_lock ;
789
798
struct qeth_ipato ipato ;
790
799
struct list_head cmd_waiter_list ;
791
800
/* QDIO buffer handling */
@@ -983,8 +992,6 @@ void qeth_clear_qdio_buffers(struct qeth_card *);
983
992
void qeth_setadp_promisc_mode (struct qeth_card * );
984
993
int qeth_setadpparms_change_macaddr (struct qeth_card * );
985
994
void qeth_tx_timeout (struct net_device * );
986
- void qeth_prepare_control_data (struct qeth_card * , int ,
987
- struct qeth_cmd_buffer * );
988
995
void qeth_release_buffer (struct qeth_channel * , struct qeth_cmd_buffer * );
989
996
void qeth_prepare_ipa_cmd (struct qeth_card * card , struct qeth_cmd_buffer * iob ,
990
997
u16 cmd_length );
0 commit comments