equal
deleted
inserted
replaced
171 data.phase = (uint8_t) master->phase; |
171 data.phase = (uint8_t) master->phase; |
172 up(&master->master_sem); |
172 up(&master->master_sem); |
173 |
173 |
174 if (down_interruptible(&master->device_sem)) |
174 if (down_interruptible(&master->device_sem)) |
175 return -EINTR; |
175 return -EINTR; |
|
176 |
176 if (master->main_device.dev) { |
177 if (master->main_device.dev) { |
177 memcpy(data.devices[0].address, |
178 memcpy(data.devices[0].address, |
178 master->main_device.dev->dev_addr, ETH_ALEN); |
179 master->main_device.dev->dev_addr, ETH_ALEN); |
179 } else { |
180 } else { |
180 memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); |
181 memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); |
192 } |
193 } |
193 data.devices[1].attached = master->backup_device.dev ? 1 : 0; |
194 data.devices[1].attached = master->backup_device.dev ? 1 : 0; |
194 data.devices[1].link_state = master->backup_device.link_state ? 1 : 0; |
195 data.devices[1].link_state = master->backup_device.link_state ? 1 : 0; |
195 data.devices[1].tx_count = master->backup_device.tx_count; |
196 data.devices[1].tx_count = master->backup_device.tx_count; |
196 data.devices[1].rx_count = master->backup_device.rx_count; |
197 data.devices[1].rx_count = master->backup_device.rx_count; |
|
198 |
197 up(&master->device_sem); |
199 up(&master->device_sem); |
|
200 |
|
201 data.app_time = master->app_time; |
|
202 data.ref_clock = EC_READ_U16(master->sync_datagram.address); |
|
203 if (data.ref_clock < 0xffff) { |
|
204 // ref_clock address is station_address, output ring position |
|
205 data.ref_clock--; |
|
206 } |
198 |
207 |
199 if (copy_to_user((void __user *) arg, &data, sizeof(data))) |
208 if (copy_to_user((void __user *) arg, &data, sizeof(data))) |
200 return -EFAULT; |
209 return -EFAULT; |
201 |
210 |
202 return 0; |
211 return 0; |