@@ -54,8 +54,6 @@ struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = {
54
54
};
55
55
EXPORT_SYMBOL_GPL (qeth_dbf );
56
56
57
- struct qeth_card_list_struct qeth_core_card_list ;
58
- EXPORT_SYMBOL_GPL (qeth_core_card_list );
59
57
struct kmem_cache * qeth_core_header_cache ;
60
58
EXPORT_SYMBOL_GPL (qeth_core_header_cache );
61
59
static struct kmem_cache * qeth_qdio_outbuf_cache ;
@@ -2837,13 +2835,25 @@ static void qeth_fill_ipacmd_header(struct qeth_card *card,
2837
2835
cmd -> hdr .prot_version = prot ;
2838
2836
}
2839
2837
2838
+ void qeth_prepare_ipa_cmd (struct qeth_card * card , struct qeth_cmd_buffer * iob )
2839
+ {
2840
+ u8 prot_type = qeth_mpc_select_prot_type (card );
2841
+
2842
+ memcpy (iob -> data , IPA_PDU_HEADER , IPA_PDU_HEADER_SIZE );
2843
+ memcpy (QETH_IPA_CMD_PROT_TYPE (iob -> data ), & prot_type , 1 );
2844
+ memcpy (QETH_IPA_CMD_DEST_ADDR (iob -> data ),
2845
+ & card -> token .ulp_connection_r , QETH_MPC_TOKEN_LENGTH );
2846
+ }
2847
+ EXPORT_SYMBOL_GPL (qeth_prepare_ipa_cmd );
2848
+
2840
2849
struct qeth_cmd_buffer * qeth_get_ipacmd_buffer (struct qeth_card * card ,
2841
2850
enum qeth_ipa_cmds ipacmd , enum qeth_prot_versions prot )
2842
2851
{
2843
2852
struct qeth_cmd_buffer * iob ;
2844
2853
2845
2854
iob = qeth_get_buffer (& card -> write );
2846
2855
if (iob ) {
2856
+ qeth_prepare_ipa_cmd (card , iob );
2847
2857
qeth_fill_ipacmd_header (card , __ipa_cmd (iob ), ipacmd , prot );
2848
2858
} else {
2849
2859
dev_warn (& card -> gdev -> dev ,
@@ -2856,17 +2866,6 @@ struct qeth_cmd_buffer *qeth_get_ipacmd_buffer(struct qeth_card *card,
2856
2866
}
2857
2867
EXPORT_SYMBOL_GPL (qeth_get_ipacmd_buffer );
2858
2868
2859
- void qeth_prepare_ipa_cmd (struct qeth_card * card , struct qeth_cmd_buffer * iob )
2860
- {
2861
- u8 prot_type = qeth_mpc_select_prot_type (card );
2862
-
2863
- memcpy (iob -> data , IPA_PDU_HEADER , IPA_PDU_HEADER_SIZE );
2864
- memcpy (QETH_IPA_CMD_PROT_TYPE (iob -> data ), & prot_type , 1 );
2865
- memcpy (QETH_IPA_CMD_DEST_ADDR (iob -> data ),
2866
- & card -> token .ulp_connection_r , QETH_MPC_TOKEN_LENGTH );
2867
- }
2868
- EXPORT_SYMBOL_GPL (qeth_prepare_ipa_cmd );
2869
-
2870
2869
/**
2871
2870
* qeth_send_ipa_cmd() - send an IPA command
2872
2871
*
@@ -2881,7 +2880,6 @@ int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
2881
2880
int rc ;
2882
2881
2883
2882
QETH_CARD_TEXT (card , 4 , "sendipa" );
2884
- qeth_prepare_ipa_cmd (card , iob );
2885
2883
rc = qeth_send_control_data (card , IPA_CMD_LENGTH ,
2886
2884
iob , reply_cb , reply_param );
2887
2885
if (rc == - ETIME ) {
@@ -3777,9 +3775,9 @@ EXPORT_SYMBOL_GPL(qeth_count_elements);
3777
3775
* The number of needed buffer elements is returned in @elements.
3778
3776
* Error to create the hdr is indicated by returning with < 0.
3779
3777
*/
3780
- int qeth_add_hw_header (struct qeth_card * card , struct sk_buff * skb ,
3781
- struct qeth_hdr * * hdr , unsigned int hdr_len ,
3782
- unsigned int proto_len , unsigned int * elements )
3778
+ static int qeth_add_hw_header (struct qeth_card * card , struct sk_buff * skb ,
3779
+ struct qeth_hdr * * hdr , unsigned int hdr_len ,
3780
+ unsigned int proto_len , unsigned int * elements )
3783
3781
{
3784
3782
const unsigned int max_elements = QETH_MAX_BUFFER_ELEMENTS (card );
3785
3783
const unsigned int contiguous = proto_len ? proto_len : 1 ;
@@ -3849,7 +3847,6 @@ int qeth_add_hw_header(struct qeth_card *card, struct sk_buff *skb,
3849
3847
skb_copy_from_linear_data (skb , ((char * )* hdr ) + hdr_len , proto_len );
3850
3848
return 0 ;
3851
3849
}
3852
- EXPORT_SYMBOL_GPL (qeth_add_hw_header );
3853
3850
3854
3851
static void __qeth_fill_buffer (struct sk_buff * skb ,
3855
3852
struct qeth_qdio_out_buffer * buf ,
@@ -3972,9 +3969,9 @@ static int qeth_fill_buffer(struct qeth_qdio_out_q *queue,
3972
3969
return flush_cnt ;
3973
3970
}
3974
3971
3975
- int qeth_do_send_packet_fast (struct qeth_qdio_out_q * queue , struct sk_buff * skb ,
3976
- struct qeth_hdr * hdr , unsigned int offset ,
3977
- unsigned int hd_len )
3972
+ static int qeth_do_send_packet_fast (struct qeth_qdio_out_q * queue ,
3973
+ struct sk_buff * skb , struct qeth_hdr * hdr ,
3974
+ unsigned int offset , unsigned int hd_len )
3978
3975
{
3979
3976
int index = queue -> next_buf_to_fill ;
3980
3977
struct qeth_qdio_out_buffer * buffer = queue -> bufs [index ];
@@ -3990,7 +3987,6 @@ int qeth_do_send_packet_fast(struct qeth_qdio_out_q *queue, struct sk_buff *skb,
3990
3987
qeth_flush_buffers (queue , index , 1 );
3991
3988
return 0 ;
3992
3989
}
3993
- EXPORT_SYMBOL_GPL (qeth_do_send_packet_fast );
3994
3990
3995
3991
int qeth_do_send_packet (struct qeth_card * card , struct qeth_qdio_out_q * queue ,
3996
3992
struct sk_buff * skb , struct qeth_hdr * hdr ,
@@ -4082,8 +4078,9 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
4082
4078
}
4083
4079
EXPORT_SYMBOL_GPL (qeth_do_send_packet );
4084
4080
4085
- void qeth_fill_tso_ext (struct qeth_hdr_tso * hdr , unsigned int payload_len ,
4086
- struct sk_buff * skb , unsigned int proto_len )
4081
+ static void qeth_fill_tso_ext (struct qeth_hdr_tso * hdr ,
4082
+ unsigned int payload_len , struct sk_buff * skb ,
4083
+ unsigned int proto_len )
4087
4084
{
4088
4085
struct qeth_hdr_ext_tso * ext = & hdr -> ext ;
4089
4086
@@ -4096,7 +4093,6 @@ void qeth_fill_tso_ext(struct qeth_hdr_tso *hdr, unsigned int payload_len,
4096
4093
ext -> mss = skb_shinfo (skb )-> gso_size ;
4097
4094
ext -> dg_hdr_len = proto_len ;
4098
4095
}
4099
- EXPORT_SYMBOL_GPL (qeth_fill_tso_ext );
4100
4096
4101
4097
int qeth_xmit (struct qeth_card * card , struct sk_buff * skb ,
4102
4098
struct qeth_qdio_out_q * queue , int ipv , int cast_type ,
@@ -4119,7 +4115,7 @@ int qeth_xmit(struct qeth_card *card, struct sk_buff *skb,
4119
4115
proto_len = skb_transport_offset (skb ) + tcp_hdrlen (skb );
4120
4116
} else {
4121
4117
hw_hdr_len = sizeof (struct qeth_hdr );
4122
- proto_len = IS_IQD (card ) ? ETH_HLEN : 0 ;
4118
+ proto_len = ( IS_IQD (card ) && IS_LAYER2 ( card ) ) ? ETH_HLEN : 0 ;
4123
4119
}
4124
4120
4125
4121
rc = skb_cow_head (skb , hw_hdr_len );
@@ -4235,16 +4231,18 @@ static int qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
4235
4231
struct qeth_reply * reply , unsigned long data )
4236
4232
{
4237
4233
struct qeth_ipa_cmd * cmd = (struct qeth_ipa_cmd * ) data ;
4234
+ struct qeth_ipacmd_setadpparms * adp_cmd ;
4238
4235
4239
4236
QETH_CARD_TEXT (card , 4 , "chgmaccb" );
4240
4237
if (qeth_setadpparms_inspect_rc (cmd ))
4241
4238
return 0 ;
4242
4239
4243
- if (IS_LAYER3 (card ) || !(card -> info .mac_bits & QETH_LAYER2_MAC_READ )) {
4244
- ether_addr_copy (card -> dev -> dev_addr ,
4245
- cmd -> data .setadapterparms .data .change_addr .addr );
4246
- card -> info .mac_bits |= QETH_LAYER2_MAC_READ ;
4247
- }
4240
+ adp_cmd = & cmd -> data .setadapterparms ;
4241
+ if (IS_LAYER2 (card ) && IS_OSD (card ) && !IS_VM_NIC (card ) &&
4242
+ !(adp_cmd -> hdr .flags & QETH_SETADP_FLAGS_VIRTUAL_MAC ))
4243
+ return 0 ;
4244
+
4245
+ ether_addr_copy (card -> dev -> dev_addr , adp_cmd -> data .change_addr .addr );
4248
4246
return 0 ;
4249
4247
}
4250
4248
@@ -4499,9 +4497,6 @@ static int qeth_send_ipa_snmp_cmd(struct qeth_card *card,
4499
4497
4500
4498
QETH_CARD_TEXT (card , 4 , "sendsnmp" );
4501
4499
4502
- memcpy (iob -> data , IPA_PDU_HEADER , IPA_PDU_HEADER_SIZE );
4503
- memcpy (QETH_IPA_CMD_DEST_ADDR (iob -> data ),
4504
- & card -> token .ulp_connection_r , QETH_MPC_TOKEN_LENGTH );
4505
4500
/* adjust PDU length fields in IPA_PDU_HEADER */
4506
4501
s1 = (u32 ) IPA_PDU_HEADER_SIZE + len ;
4507
4502
s2 = (u32 ) len ;
@@ -5480,34 +5475,11 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
5480
5475
}
5481
5476
EXPORT_SYMBOL_GPL (qeth_get_setassparms_cmd );
5482
5477
5483
- static int qeth_send_setassparms (struct qeth_card * card ,
5484
- struct qeth_cmd_buffer * iob , u16 len ,
5485
- long data , int (* reply_cb )(struct qeth_card * ,
5486
- struct qeth_reply * ,
5487
- unsigned long ),
5488
- void * reply_param )
5489
- {
5490
- int rc ;
5491
- struct qeth_ipa_cmd * cmd ;
5492
-
5493
- QETH_CARD_TEXT (card , 4 , "sendassp" );
5494
-
5495
- cmd = __ipa_cmd (iob );
5496
- if (len <= sizeof (__u32 ))
5497
- cmd -> data .setassparms .data .flags_32bit = (__u32 ) data ;
5498
- else /* (len > sizeof(__u32)) */
5499
- memcpy (& cmd -> data .setassparms .data , (void * ) data , len );
5500
-
5501
- rc = qeth_send_ipa_cmd (card , iob , reply_cb , reply_param );
5502
- return rc ;
5503
- }
5504
-
5505
5478
int qeth_send_simple_setassparms_prot (struct qeth_card * card ,
5506
5479
enum qeth_ipa_funcs ipa_func ,
5507
5480
u16 cmd_code , long data ,
5508
5481
enum qeth_prot_versions prot )
5509
5482
{
5510
- int rc ;
5511
5483
int length = 0 ;
5512
5484
struct qeth_cmd_buffer * iob ;
5513
5485
@@ -5517,9 +5489,9 @@ int qeth_send_simple_setassparms_prot(struct qeth_card *card,
5517
5489
iob = qeth_get_setassparms_cmd (card , ipa_func , cmd_code , length , prot );
5518
5490
if (!iob )
5519
5491
return - ENOMEM ;
5520
- rc = qeth_send_setassparms ( card , iob , length , data ,
5521
- qeth_setassparms_cb , NULL ) ;
5522
- return rc ;
5492
+
5493
+ __ipa_cmd ( iob ) -> data . setassparms . data . flags_32bit = ( __u32 ) data ;
5494
+ return qeth_send_ipa_cmd ( card , iob , qeth_setassparms_cb , NULL ) ;
5523
5495
}
5524
5496
EXPORT_SYMBOL_GPL (qeth_send_simple_setassparms_prot );
5525
5497
@@ -5806,9 +5778,6 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
5806
5778
break ;
5807
5779
}
5808
5780
5809
- write_lock_irq (& qeth_core_card_list .rwlock );
5810
- list_add_tail (& card -> list , & qeth_core_card_list .list );
5811
- write_unlock_irq (& qeth_core_card_list .rwlock );
5812
5781
return 0 ;
5813
5782
5814
5783
err_disc :
@@ -5833,9 +5802,6 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev)
5833
5802
qeth_core_free_discipline (card );
5834
5803
}
5835
5804
5836
- write_lock_irq (& qeth_core_card_list .rwlock );
5837
- list_del (& card -> list );
5838
- write_unlock_irq (& qeth_core_card_list .rwlock );
5839
5805
free_netdev (card -> dev );
5840
5806
qeth_core_free_card (card );
5841
5807
put_device (& gdev -> dev );
@@ -5950,6 +5916,21 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
5950
5916
.restore = qeth_core_restore ,
5951
5917
};
5952
5918
5919
+ struct qeth_card * qeth_get_card_by_busid (char * bus_id )
5920
+ {
5921
+ struct ccwgroup_device * gdev ;
5922
+ struct qeth_card * card ;
5923
+
5924
+ gdev = get_ccwgroupdev_by_busid (& qeth_core_ccwgroup_driver , bus_id );
5925
+ if (!gdev )
5926
+ return NULL ;
5927
+
5928
+ card = dev_get_drvdata (& gdev -> dev );
5929
+ put_device (& gdev -> dev );
5930
+ return card ;
5931
+ }
5932
+ EXPORT_SYMBOL_GPL (qeth_get_card_by_busid );
5933
+
5953
5934
int qeth_do_ioctl (struct net_device * dev , struct ifreq * rq , int cmd )
5954
5935
{
5955
5936
struct qeth_card * card = dev -> ml_priv ;
@@ -6381,16 +6362,16 @@ static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,
6381
6362
enum qeth_prot_versions prot )
6382
6363
{
6383
6364
struct qeth_cmd_buffer * iob ;
6384
- int rc = - ENOMEM ;
6385
6365
6386
6366
QETH_CARD_TEXT (card , 4 , "chkdocmd" );
6387
6367
iob = qeth_get_setassparms_cmd (card , ipa_func , cmd_code ,
6388
6368
sizeof (__u32 ), prot );
6389
- if (iob )
6390
- rc = qeth_send_setassparms (card , iob , sizeof (__u32 ), data ,
6391
- qeth_ipa_checksum_run_cmd_cb ,
6392
- chksum_cb );
6393
- return rc ;
6369
+ if (!iob )
6370
+ return - ENOMEM ;
6371
+
6372
+ __ipa_cmd (iob )-> data .setassparms .data .flags_32bit = (__u32 ) data ;
6373
+ return qeth_send_ipa_cmd (card , iob , qeth_ipa_checksum_run_cmd_cb ,
6374
+ chksum_cb );
6394
6375
}
6395
6376
6396
6377
static int qeth_send_checksum_on (struct qeth_card * card , int cstype ,
@@ -6488,8 +6469,7 @@ static int qeth_set_tso_on(struct qeth_card *card,
6488
6469
if (!iob )
6489
6470
return - ENOMEM ;
6490
6471
6491
- rc = qeth_send_setassparms (card , iob , 0 , 0 /* unused */ ,
6492
- qeth_start_tso_cb , & tso_data );
6472
+ rc = qeth_send_ipa_cmd (card , iob , qeth_start_tso_cb , & tso_data );
6493
6473
if (rc )
6494
6474
return rc ;
6495
6475
@@ -6506,10 +6486,9 @@ static int qeth_set_tso_on(struct qeth_card *card,
6506
6486
}
6507
6487
6508
6488
/* enable TSO capability */
6509
- caps .supported = 0 ;
6510
- caps .enabled = QETH_IPA_LARGE_SEND_TCP ;
6511
- rc = qeth_send_setassparms (card , iob , sizeof (caps ), (long ) & caps ,
6512
- qeth_setassparms_get_caps_cb , & caps );
6489
+ __ipa_cmd (iob )-> data .setassparms .data .caps .enabled =
6490
+ QETH_IPA_LARGE_SEND_TCP ;
6491
+ rc = qeth_send_ipa_cmd (card , iob , qeth_setassparms_get_caps_cb , & caps );
6513
6492
if (rc ) {
6514
6493
qeth_set_tso_off (card , prot );
6515
6494
return rc ;
@@ -6688,8 +6667,6 @@ static int __init qeth_core_init(void)
6688
6667
int rc ;
6689
6668
6690
6669
pr_info ("loading core functions\n" );
6691
- INIT_LIST_HEAD (& qeth_core_card_list .list );
6692
- rwlock_init (& qeth_core_card_list .rwlock );
6693
6670
6694
6671
qeth_wq = create_singlethread_workqueue ("qeth_wq" );
6695
6672
if (!qeth_wq ) {
0 commit comments