133 data.domain_count = ec_master_domain_count(master); |
133 data.domain_count = ec_master_domain_count(master); |
134 data.phase = (uint8_t) master->phase; |
134 data.phase = (uint8_t) master->phase; |
135 up(&master->master_sem); |
135 up(&master->master_sem); |
136 |
136 |
137 down(&master->device_sem); |
137 down(&master->device_sem); |
138 memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); |
138 if (master->main_device.dev) { |
|
139 memcpy(data.devices[0].address, |
|
140 master->main_device.dev->dev_addr, ETH_ALEN); |
|
141 } else { |
|
142 memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); |
|
143 } |
139 data.devices[0].attached = master->main_device.dev ? 1 : 0; |
144 data.devices[0].attached = master->main_device.dev ? 1 : 0; |
140 data.devices[0].tx_count = master->main_device.tx_count; |
145 data.devices[0].tx_count = master->main_device.tx_count; |
141 data.devices[0].rx_count = master->main_device.rx_count; |
146 data.devices[0].rx_count = master->main_device.rx_count; |
142 memcpy(data.devices[1].address, master->backup_mac, ETH_ALEN); |
147 |
|
148 if (master->backup_device.dev) { |
|
149 memcpy(data.devices[1].address, |
|
150 master->backup_device.dev->dev_addr, ETH_ALEN); |
|
151 } else { |
|
152 memcpy(data.devices[1].address, master->backup_mac, ETH_ALEN); |
|
153 } |
143 data.devices[1].attached = master->backup_device.dev ? 1 : 0; |
154 data.devices[1].attached = master->backup_device.dev ? 1 : 0; |
144 data.devices[1].tx_count = master->backup_device.tx_count; |
155 data.devices[1].tx_count = master->backup_device.tx_count; |
145 data.devices[1].rx_count = master->backup_device.rx_count; |
156 data.devices[1].rx_count = master->backup_device.rx_count; |
146 up(&master->device_sem); |
157 up(&master->device_sem); |
147 |
158 |