master/slave.c
changeset 1000 5746fdd1ca2e
parent 992 50a44cbd30af
child 1055 2be8918682fa
equal deleted inserted replaced
999:14307580deb6 1000:5746fdd1ca2e
    70         uint16_t station_address /**< station address to configure */
    70         uint16_t station_address /**< station address to configure */
    71         )
    71         )
    72 {
    72 {
    73     unsigned int i;
    73     unsigned int i;
    74 
    74 
       
    75     slave->master = master;
    75     slave->ring_position = ring_position;
    76     slave->ring_position = ring_position;
    76     slave->station_address = station_address;
    77     slave->station_address = station_address;
    77 
       
    78     slave->master = master;
       
    79 
    78 
    80     slave->config = NULL;
    79     slave->config = NULL;
    81     slave->requested_state = EC_SLAVE_STATE_PREOP;
    80     slave->requested_state = EC_SLAVE_STATE_PREOP;
    82     slave->current_state = EC_SLAVE_STATE_UNKNOWN;
    81     slave->current_state = EC_SLAVE_STATE_UNKNOWN;
    83     slave->error_flag = 0;
    82     slave->error_flag = 0;
    85 
    84 
    86     slave->base_type = 0;
    85     slave->base_type = 0;
    87     slave->base_revision = 0;
    86     slave->base_revision = 0;
    88     slave->base_build = 0;
    87     slave->base_build = 0;
    89     slave->base_fmmu_count = 0;
    88     slave->base_fmmu_count = 0;
       
    89 
       
    90     for (i = 0; i < EC_SLAVE_MAX_PORTS; i++) {
       
    91         slave->ports[i].dl_link = 0;
       
    92         slave->ports[i].dl_loop = 0;
       
    93         slave->ports[i].dl_signal = 0;
       
    94         slave->sii.physical_layer[i] = 0xFF;
       
    95     }
    90 
    96 
    91     slave->sii_words = NULL;
    97     slave->sii_words = NULL;
    92     slave->sii_nwords = 0;
    98     slave->sii_nwords = 0;
    93 
    99 
    94     slave->sii.alias = 0;
   100     slave->sii.alias = 0;
   121 
   127 
   122     INIT_LIST_HEAD(&slave->sdo_dictionary);
   128     INIT_LIST_HEAD(&slave->sdo_dictionary);
   123 
   129 
   124     slave->sdo_dictionary_fetched = 0;
   130     slave->sdo_dictionary_fetched = 0;
   125     slave->jiffies_preop = 0;
   131     slave->jiffies_preop = 0;
   126 
       
   127     for (i = 0; i < 4; i++) {
       
   128         slave->dl_link[i] = 0;
       
   129         slave->dl_loop[i] = 0;
       
   130         slave->dl_signal[i] = 0;
       
   131         slave->sii.physical_layer[i] = 0xFF;
       
   132     }
       
   133 }
   132 }
   134 
   133 
   135 /*****************************************************************************/
   134 /*****************************************************************************/
   136 
   135 
   137 /**
   136 /**