• Julian Wiedmann's avatar
    s390/qeth: consolidate filling of low-level cmd length fields · c2153277
    Julian Wiedmann authored
    The code to fill the IPA length fields is duplicated three times across
    the driver:
    1. qeth_send_ipa_cmd() sets IPA_CMD_LENGTH, which matches the defaults
       in the IPA_PDU_HEADER template.
    2. for OSN, qeth_osn_send_ipa_cmd() bypasses this logic and inserts the
       length passed by the caller.
    3. SNMP commands (that can outgrow IPA_CMD_LENGTH) have their own way
       of setting the length fields, via qeth_send_ipa_snmp_cmd().
    
    Consolidate this into qeth_prepare_ipa_cmd(), which all originators of
    IPA cmds already call during setup of their cmd. Let qeth_send_ipa_cmd()
    pull the length from the cmd instead of hard-coding IPA_CMD_LENGTH.
    
    For now, the SNMP code still needs to fix-up its length fields manually.
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c2153277
qeth_core_mpc.c 9.85 KB