Lines Matching refs:ret
80 int ret; in __smsc75xx_read_reg() local
90 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN in __smsc75xx_read_reg()
93 if (unlikely(ret < 4)) { in __smsc75xx_read_reg()
94 ret = ret < 0 ? ret : -ENODATA; in __smsc75xx_read_reg()
97 index, ret); in __smsc75xx_read_reg()
98 return ret; in __smsc75xx_read_reg()
104 return ret; in __smsc75xx_read_reg()
111 int ret; in __smsc75xx_write_reg() local
124 ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT in __smsc75xx_write_reg()
127 if (unlikely(ret < 0)) in __smsc75xx_write_reg()
129 index, ret); in __smsc75xx_write_reg()
131 return ret; in __smsc75xx_write_reg()
165 int ret; in __smsc75xx_phy_wait_not_busy() local
168 ret = __smsc75xx_read_reg(dev, MII_ACCESS, &val, in_pm); in __smsc75xx_phy_wait_not_busy()
169 if (ret < 0) { in __smsc75xx_phy_wait_not_busy()
171 return ret; in __smsc75xx_phy_wait_not_busy()
186 int ret; in __smsc75xx_mdio_read() local
191 ret = __smsc75xx_phy_wait_not_busy(dev, in_pm); in __smsc75xx_mdio_read()
192 if (ret < 0) { in __smsc75xx_mdio_read()
203 ret = __smsc75xx_write_reg(dev, MII_ACCESS, addr, in_pm); in __smsc75xx_mdio_read()
204 if (ret < 0) { in __smsc75xx_mdio_read()
209 ret = __smsc75xx_phy_wait_not_busy(dev, in_pm); in __smsc75xx_mdio_read()
210 if (ret < 0) { in __smsc75xx_mdio_read()
215 ret = __smsc75xx_read_reg(dev, MII_DATA, &val, in_pm); in __smsc75xx_mdio_read()
216 if (ret < 0) { in __smsc75xx_mdio_read()
221 ret = (u16)(val & 0xFFFF); in __smsc75xx_mdio_read()
225 return ret; in __smsc75xx_mdio_read()
233 int ret; in __smsc75xx_mdio_write() local
238 ret = __smsc75xx_phy_wait_not_busy(dev, in_pm); in __smsc75xx_mdio_write()
239 if (ret < 0) { in __smsc75xx_mdio_write()
245 ret = __smsc75xx_write_reg(dev, MII_DATA, val, in_pm); in __smsc75xx_mdio_write()
246 if (ret < 0) { in __smsc75xx_mdio_write()
257 ret = __smsc75xx_write_reg(dev, MII_ACCESS, addr, in_pm); in __smsc75xx_mdio_write()
258 if (ret < 0) { in __smsc75xx_mdio_write()
263 ret = __smsc75xx_phy_wait_not_busy(dev, in_pm); in __smsc75xx_mdio_write()
264 if (ret < 0) { in __smsc75xx_mdio_write()
300 int ret; in smsc75xx_wait_eeprom() local
303 ret = smsc75xx_read_reg(dev, E2P_CMD, &val); in smsc75xx_wait_eeprom()
304 if (ret < 0) { in smsc75xx_wait_eeprom()
306 return ret; in smsc75xx_wait_eeprom()
326 int ret; in smsc75xx_eeprom_confirm_not_busy() local
329 ret = smsc75xx_read_reg(dev, E2P_CMD, &val); in smsc75xx_eeprom_confirm_not_busy()
330 if (ret < 0) { in smsc75xx_eeprom_confirm_not_busy()
332 return ret; in smsc75xx_eeprom_confirm_not_busy()
349 int i, ret; in smsc75xx_read_eeprom() local
354 ret = smsc75xx_eeprom_confirm_not_busy(dev); in smsc75xx_read_eeprom()
355 if (ret) in smsc75xx_read_eeprom()
356 return ret; in smsc75xx_read_eeprom()
360 ret = smsc75xx_write_reg(dev, E2P_CMD, val); in smsc75xx_read_eeprom()
361 if (ret < 0) { in smsc75xx_read_eeprom()
363 return ret; in smsc75xx_read_eeprom()
366 ret = smsc75xx_wait_eeprom(dev); in smsc75xx_read_eeprom()
367 if (ret < 0) in smsc75xx_read_eeprom()
368 return ret; in smsc75xx_read_eeprom()
370 ret = smsc75xx_read_reg(dev, E2P_DATA, &val); in smsc75xx_read_eeprom()
371 if (ret < 0) { in smsc75xx_read_eeprom()
373 return ret; in smsc75xx_read_eeprom()
387 int i, ret; in smsc75xx_write_eeprom() local
392 ret = smsc75xx_eeprom_confirm_not_busy(dev); in smsc75xx_write_eeprom()
393 if (ret) in smsc75xx_write_eeprom()
394 return ret; in smsc75xx_write_eeprom()
398 ret = smsc75xx_write_reg(dev, E2P_CMD, val); in smsc75xx_write_eeprom()
399 if (ret < 0) { in smsc75xx_write_eeprom()
401 return ret; in smsc75xx_write_eeprom()
404 ret = smsc75xx_wait_eeprom(dev); in smsc75xx_write_eeprom()
405 if (ret < 0) in smsc75xx_write_eeprom()
406 return ret; in smsc75xx_write_eeprom()
412 ret = smsc75xx_write_reg(dev, E2P_DATA, val); in smsc75xx_write_eeprom()
413 if (ret < 0) { in smsc75xx_write_eeprom()
415 return ret; in smsc75xx_write_eeprom()
420 ret = smsc75xx_write_reg(dev, E2P_CMD, val); in smsc75xx_write_eeprom()
421 if (ret < 0) { in smsc75xx_write_eeprom()
423 return ret; in smsc75xx_write_eeprom()
426 ret = smsc75xx_wait_eeprom(dev); in smsc75xx_write_eeprom()
427 if (ret < 0) in smsc75xx_write_eeprom()
428 return ret; in smsc75xx_write_eeprom()
438 int i, ret; in smsc75xx_dataport_wait_not_busy() local
442 ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); in smsc75xx_dataport_wait_not_busy()
443 if (ret < 0) { in smsc75xx_dataport_wait_not_busy()
445 return ret; in smsc75xx_dataport_wait_not_busy()
464 int i, ret; in smsc75xx_dataport_write() local
468 ret = smsc75xx_dataport_wait_not_busy(dev); in smsc75xx_dataport_write()
469 if (ret < 0) { in smsc75xx_dataport_write()
474 ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); in smsc75xx_dataport_write()
475 if (ret < 0) { in smsc75xx_dataport_write()
482 ret = smsc75xx_write_reg(dev, DP_SEL, dp_sel); in smsc75xx_dataport_write()
483 if (ret < 0) { in smsc75xx_dataport_write()
489 ret = smsc75xx_write_reg(dev, DP_ADDR, addr + i); in smsc75xx_dataport_write()
490 if (ret < 0) { in smsc75xx_dataport_write()
495 ret = smsc75xx_write_reg(dev, DP_DATA, buf[i]); in smsc75xx_dataport_write()
496 if (ret < 0) { in smsc75xx_dataport_write()
501 ret = smsc75xx_write_reg(dev, DP_CMD, DP_CMD_WRITE); in smsc75xx_dataport_write()
502 if (ret < 0) { in smsc75xx_dataport_write()
507 ret = smsc75xx_dataport_wait_not_busy(dev); in smsc75xx_dataport_write()
508 if (ret < 0) { in smsc75xx_dataport_write()
516 return ret; in smsc75xx_dataport_write()
530 int ret; in smsc75xx_deferred_multicast_write() local
538 ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); in smsc75xx_deferred_multicast_write()
539 if (ret < 0) in smsc75xx_deferred_multicast_write()
592 int ret; in smsc75xx_update_flowcontrol() local
613 ret = smsc75xx_write_reg(dev, FLOW, flow); in smsc75xx_update_flowcontrol()
614 if (ret < 0) { in smsc75xx_update_flowcontrol()
616 return ret; in smsc75xx_update_flowcontrol()
619 ret = smsc75xx_write_reg(dev, FCT_FLOW, fct_flow); in smsc75xx_update_flowcontrol()
620 if (ret < 0) { in smsc75xx_update_flowcontrol()
622 return ret; in smsc75xx_update_flowcontrol()
633 int ret; in smsc75xx_link_reset() local
639 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); in smsc75xx_link_reset()
640 if (ret < 0) { in smsc75xx_link_reset()
642 return ret; in smsc75xx_link_reset()
721 int ret; in smsc75xx_ethtool_set_wol() local
728 ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts); in smsc75xx_ethtool_set_wol()
729 if (ret < 0) in smsc75xx_ethtool_set_wol()
730 netdev_warn(dev->net, "device_set_wakeup_enable error %d\n", ret); in smsc75xx_ethtool_set_wol()
732 return ret; in smsc75xx_ethtool_set_wol()
795 int ret = smsc75xx_write_reg(dev, RX_ADDRH, addr_hi); in smsc75xx_set_mac_address() local
796 if (ret < 0) { in smsc75xx_set_mac_address()
797 netdev_warn(dev->net, "Failed to write RX_ADDRH: %d\n", ret); in smsc75xx_set_mac_address()
798 return ret; in smsc75xx_set_mac_address()
801 ret = smsc75xx_write_reg(dev, RX_ADDRL, addr_lo); in smsc75xx_set_mac_address()
802 if (ret < 0) { in smsc75xx_set_mac_address()
803 netdev_warn(dev->net, "Failed to write RX_ADDRL: %d\n", ret); in smsc75xx_set_mac_address()
804 return ret; in smsc75xx_set_mac_address()
808 ret = smsc75xx_write_reg(dev, ADDR_FILTX, addr_hi); in smsc75xx_set_mac_address()
809 if (ret < 0) { in smsc75xx_set_mac_address()
810 netdev_warn(dev->net, "Failed to write ADDR_FILTX: %d\n", ret); in smsc75xx_set_mac_address()
811 return ret; in smsc75xx_set_mac_address()
814 ret = smsc75xx_write_reg(dev, ADDR_FILTX + 4, addr_lo); in smsc75xx_set_mac_address()
815 if (ret < 0) in smsc75xx_set_mac_address()
816 netdev_warn(dev->net, "Failed to write ADDR_FILTX+4: %d\n", ret); in smsc75xx_set_mac_address()
818 return ret; in smsc75xx_set_mac_address()
823 int bmcr, ret, timeout = 0; in smsc75xx_phy_initialize() local
862 ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); in smsc75xx_phy_initialize()
863 if (ret < 0) { in smsc75xx_phy_initialize()
865 return ret; in smsc75xx_phy_initialize()
880 int ret = 0; in smsc75xx_set_rx_max_frame_length() local
884 ret = smsc75xx_read_reg(dev, MAC_RX, &buf); in smsc75xx_set_rx_max_frame_length()
885 if (ret < 0) { in smsc75xx_set_rx_max_frame_length()
886 netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret); in smsc75xx_set_rx_max_frame_length()
887 return ret; in smsc75xx_set_rx_max_frame_length()
894 ret = smsc75xx_write_reg(dev, MAC_RX, buf); in smsc75xx_set_rx_max_frame_length()
895 if (ret < 0) { in smsc75xx_set_rx_max_frame_length()
896 netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret); in smsc75xx_set_rx_max_frame_length()
897 return ret; in smsc75xx_set_rx_max_frame_length()
905 ret = smsc75xx_write_reg(dev, MAC_RX, buf); in smsc75xx_set_rx_max_frame_length()
906 if (ret < 0) { in smsc75xx_set_rx_max_frame_length()
907 netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret); in smsc75xx_set_rx_max_frame_length()
908 return ret; in smsc75xx_set_rx_max_frame_length()
913 ret = smsc75xx_write_reg(dev, MAC_RX, buf); in smsc75xx_set_rx_max_frame_length()
914 if (ret < 0) { in smsc75xx_set_rx_max_frame_length()
915 netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret); in smsc75xx_set_rx_max_frame_length()
916 return ret; in smsc75xx_set_rx_max_frame_length()
926 int ret; in smsc75xx_change_mtu() local
928 ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN); in smsc75xx_change_mtu()
929 if (ret < 0) { in smsc75xx_change_mtu()
931 return ret; in smsc75xx_change_mtu()
944 int ret; in smsc75xx_set_features() local
956 ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); in smsc75xx_set_features()
957 if (ret < 0) { in smsc75xx_set_features()
959 return ret; in smsc75xx_set_features()
970 int ret; in smsc75xx_wait_ready() local
972 ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm); in smsc75xx_wait_ready()
974 if (ret < 0) { in smsc75xx_wait_ready()
975 netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret); in smsc75xx_wait_ready()
976 return ret; in smsc75xx_wait_ready()
993 int ret = 0, timeout = 0; in smsc75xx_phy_gig_workaround() local
1012 ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); in smsc75xx_phy_gig_workaround()
1013 if (ret < 0) { in smsc75xx_phy_gig_workaround()
1014 netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret); in smsc75xx_phy_gig_workaround()
1015 return ret; in smsc75xx_phy_gig_workaround()
1020 ret = smsc75xx_write_reg(dev, PMT_CTL, buf); in smsc75xx_phy_gig_workaround()
1021 if (ret < 0) { in smsc75xx_phy_gig_workaround()
1022 netdev_warn(dev->net, "Failed to write PMT_CTL: %d\n", ret); in smsc75xx_phy_gig_workaround()
1023 return ret; in smsc75xx_phy_gig_workaround()
1029 ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); in smsc75xx_phy_gig_workaround()
1030 if (ret < 0) { in smsc75xx_phy_gig_workaround()
1032 ret); in smsc75xx_phy_gig_workaround()
1033 return ret; in smsc75xx_phy_gig_workaround()
1050 int ret = 0, timeout; in smsc75xx_reset() local
1054 ret = smsc75xx_wait_ready(dev, 0); in smsc75xx_reset()
1055 if (ret < 0) { in smsc75xx_reset()
1057 return ret; in smsc75xx_reset()
1060 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1061 if (ret < 0) { in smsc75xx_reset()
1062 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1063 return ret; in smsc75xx_reset()
1068 ret = smsc75xx_write_reg(dev, HW_CFG, buf); in smsc75xx_reset()
1069 if (ret < 0) { in smsc75xx_reset()
1070 netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret); in smsc75xx_reset()
1071 return ret; in smsc75xx_reset()
1077 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1078 if (ret < 0) { in smsc75xx_reset()
1079 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1080 return ret; in smsc75xx_reset()
1092 ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); in smsc75xx_reset()
1093 if (ret < 0) { in smsc75xx_reset()
1094 netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret); in smsc75xx_reset()
1095 return ret; in smsc75xx_reset()
1100 ret = smsc75xx_write_reg(dev, PMT_CTL, buf); in smsc75xx_reset()
1101 if (ret < 0) { in smsc75xx_reset()
1102 netdev_warn(dev->net, "Failed to write PMT_CTL: %d\n", ret); in smsc75xx_reset()
1103 return ret; in smsc75xx_reset()
1109 ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); in smsc75xx_reset()
1110 if (ret < 0) { in smsc75xx_reset()
1111 netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret); in smsc75xx_reset()
1112 return ret; in smsc75xx_reset()
1124 ret = smsc75xx_set_mac_address(dev); in smsc75xx_reset()
1125 if (ret < 0) { in smsc75xx_reset()
1127 return ret; in smsc75xx_reset()
1133 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1134 if (ret < 0) { in smsc75xx_reset()
1135 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1136 return ret; in smsc75xx_reset()
1144 ret = smsc75xx_write_reg(dev, HW_CFG, buf); in smsc75xx_reset()
1145 if (ret < 0) { in smsc75xx_reset()
1146 netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret); in smsc75xx_reset()
1147 return ret; in smsc75xx_reset()
1150 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1151 if (ret < 0) { in smsc75xx_reset()
1152 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1153 return ret; in smsc75xx_reset()
1173 ret = smsc75xx_write_reg(dev, BURST_CAP, buf); in smsc75xx_reset()
1174 if (ret < 0) { in smsc75xx_reset()
1175 netdev_warn(dev->net, "Failed to write BURST_CAP: %d\n", ret); in smsc75xx_reset()
1176 return ret; in smsc75xx_reset()
1179 ret = smsc75xx_read_reg(dev, BURST_CAP, &buf); in smsc75xx_reset()
1180 if (ret < 0) { in smsc75xx_reset()
1181 netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); in smsc75xx_reset()
1182 return ret; in smsc75xx_reset()
1188 ret = smsc75xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY); in smsc75xx_reset()
1189 if (ret < 0) { in smsc75xx_reset()
1190 netdev_warn(dev->net, "Failed to write BULK_IN_DLY: %d\n", ret); in smsc75xx_reset()
1191 return ret; in smsc75xx_reset()
1194 ret = smsc75xx_read_reg(dev, BULK_IN_DLY, &buf); in smsc75xx_reset()
1195 if (ret < 0) { in smsc75xx_reset()
1196 netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); in smsc75xx_reset()
1197 return ret; in smsc75xx_reset()
1204 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1205 if (ret < 0) { in smsc75xx_reset()
1206 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1207 return ret; in smsc75xx_reset()
1214 ret = smsc75xx_write_reg(dev, HW_CFG, buf); in smsc75xx_reset()
1215 if (ret < 0) { in smsc75xx_reset()
1216 netdev_warn(dev->net, "Failed to write HW_CFG: %d\n", ret); in smsc75xx_reset()
1217 return ret; in smsc75xx_reset()
1220 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); in smsc75xx_reset()
1221 if (ret < 0) { in smsc75xx_reset()
1222 netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); in smsc75xx_reset()
1223 return ret; in smsc75xx_reset()
1231 ret = smsc75xx_write_reg(dev, FCT_RX_FIFO_END, buf); in smsc75xx_reset()
1232 if (ret < 0) { in smsc75xx_reset()
1233 netdev_warn(dev->net, "Failed to write FCT_RX_FIFO_END: %d\n", ret); in smsc75xx_reset()
1234 return ret; in smsc75xx_reset()
1240 ret = smsc75xx_write_reg(dev, FCT_TX_FIFO_END, buf); in smsc75xx_reset()
1241 if (ret < 0) { in smsc75xx_reset()
1242 netdev_warn(dev->net, "Failed to write FCT_TX_FIFO_END: %d\n", ret); in smsc75xx_reset()
1243 return ret; in smsc75xx_reset()
1248 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); in smsc75xx_reset()
1249 if (ret < 0) { in smsc75xx_reset()
1250 netdev_warn(dev->net, "Failed to write INT_STS: %d\n", ret); in smsc75xx_reset()
1251 return ret; in smsc75xx_reset()
1254 ret = smsc75xx_read_reg(dev, ID_REV, &buf); in smsc75xx_reset()
1255 if (ret < 0) { in smsc75xx_reset()
1256 netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); in smsc75xx_reset()
1257 return ret; in smsc75xx_reset()
1262 ret = smsc75xx_read_reg(dev, E2P_CMD, &buf); in smsc75xx_reset()
1263 if (ret < 0) { in smsc75xx_reset()
1264 netdev_warn(dev->net, "Failed to read E2P_CMD: %d\n", ret); in smsc75xx_reset()
1265 return ret; in smsc75xx_reset()
1270 ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf); in smsc75xx_reset()
1271 if (ret < 0) { in smsc75xx_reset()
1272 netdev_warn(dev->net, "Failed to read LED_GPIO_CFG: %d\n", ret); in smsc75xx_reset()
1273 return ret; in smsc75xx_reset()
1279 ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf); in smsc75xx_reset()
1280 if (ret < 0) { in smsc75xx_reset()
1281 netdev_warn(dev->net, "Failed to write LED_GPIO_CFG: %d\n", ret); in smsc75xx_reset()
1282 return ret; in smsc75xx_reset()
1286 ret = smsc75xx_write_reg(dev, FLOW, 0); in smsc75xx_reset()
1287 if (ret < 0) { in smsc75xx_reset()
1288 netdev_warn(dev->net, "Failed to write FLOW: %d\n", ret); in smsc75xx_reset()
1289 return ret; in smsc75xx_reset()
1292 ret = smsc75xx_write_reg(dev, FCT_FLOW, 0); in smsc75xx_reset()
1293 if (ret < 0) { in smsc75xx_reset()
1294 netdev_warn(dev->net, "Failed to write FCT_FLOW: %d\n", ret); in smsc75xx_reset()
1295 return ret; in smsc75xx_reset()
1299 ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); in smsc75xx_reset()
1300 if (ret < 0) { in smsc75xx_reset()
1301 netdev_warn(dev->net, "Failed to read RFE_CTL: %d\n", ret); in smsc75xx_reset()
1302 return ret; in smsc75xx_reset()
1307 ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); in smsc75xx_reset()
1308 if (ret < 0) { in smsc75xx_reset()
1309 netdev_warn(dev->net, "Failed to write RFE_CTL: %d\n", ret); in smsc75xx_reset()
1310 return ret; in smsc75xx_reset()
1313 ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); in smsc75xx_reset()
1314 if (ret < 0) { in smsc75xx_reset()
1315 netdev_warn(dev->net, "Failed to read RFE_CTL: %d\n", ret); in smsc75xx_reset()
1316 return ret; in smsc75xx_reset()
1327 ret = smsc75xx_phy_initialize(dev); in smsc75xx_reset()
1328 if (ret < 0) { in smsc75xx_reset()
1329 netdev_warn(dev->net, "Failed to initialize PHY: %d\n", ret); in smsc75xx_reset()
1330 return ret; in smsc75xx_reset()
1333 ret = smsc75xx_read_reg(dev, INT_EP_CTL, &buf); in smsc75xx_reset()
1334 if (ret < 0) { in smsc75xx_reset()
1335 netdev_warn(dev->net, "Failed to read INT_EP_CTL: %d\n", ret); in smsc75xx_reset()
1336 return ret; in smsc75xx_reset()
1342 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); in smsc75xx_reset()
1343 if (ret < 0) { in smsc75xx_reset()
1344 netdev_warn(dev->net, "Failed to write INT_EP_CTL: %d\n", ret); in smsc75xx_reset()
1345 return ret; in smsc75xx_reset()
1349 ret = smsc75xx_read_reg(dev, MAC_CR, &buf); in smsc75xx_reset()
1350 if (ret < 0) { in smsc75xx_reset()
1351 netdev_warn(dev->net, "Failed to read MAC_CR: %d\n", ret); in smsc75xx_reset()
1352 return ret; in smsc75xx_reset()
1356 ret = smsc75xx_write_reg(dev, MAC_CR, buf); in smsc75xx_reset()
1357 if (ret < 0) { in smsc75xx_reset()
1358 netdev_warn(dev->net, "Failed to write MAC_CR: %d\n", ret); in smsc75xx_reset()
1359 return ret; in smsc75xx_reset()
1362 ret = smsc75xx_read_reg(dev, MAC_TX, &buf); in smsc75xx_reset()
1363 if (ret < 0) { in smsc75xx_reset()
1364 netdev_warn(dev->net, "Failed to read MAC_TX: %d\n", ret); in smsc75xx_reset()
1365 return ret; in smsc75xx_reset()
1370 ret = smsc75xx_write_reg(dev, MAC_TX, buf); in smsc75xx_reset()
1371 if (ret < 0) { in smsc75xx_reset()
1372 netdev_warn(dev->net, "Failed to write MAC_TX: %d\n", ret); in smsc75xx_reset()
1373 return ret; in smsc75xx_reset()
1378 ret = smsc75xx_read_reg(dev, FCT_TX_CTL, &buf); in smsc75xx_reset()
1379 if (ret < 0) { in smsc75xx_reset()
1380 netdev_warn(dev->net, "Failed to read FCT_TX_CTL: %d\n", ret); in smsc75xx_reset()
1381 return ret; in smsc75xx_reset()
1386 ret = smsc75xx_write_reg(dev, FCT_TX_CTL, buf); in smsc75xx_reset()
1387 if (ret < 0) { in smsc75xx_reset()
1388 netdev_warn(dev->net, "Failed to write FCT_TX_CTL: %d\n", ret); in smsc75xx_reset()
1389 return ret; in smsc75xx_reset()
1394 ret = smsc75xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN); in smsc75xx_reset()
1395 if (ret < 0) { in smsc75xx_reset()
1397 return ret; in smsc75xx_reset()
1400 ret = smsc75xx_read_reg(dev, MAC_RX, &buf); in smsc75xx_reset()
1401 if (ret < 0) { in smsc75xx_reset()
1402 netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret); in smsc75xx_reset()
1403 return ret; in smsc75xx_reset()
1408 ret = smsc75xx_write_reg(dev, MAC_RX, buf); in smsc75xx_reset()
1409 if (ret < 0) { in smsc75xx_reset()
1410 netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret); in smsc75xx_reset()
1411 return ret; in smsc75xx_reset()
1416 ret = smsc75xx_read_reg(dev, FCT_RX_CTL, &buf); in smsc75xx_reset()
1417 if (ret < 0) { in smsc75xx_reset()
1418 netdev_warn(dev->net, "Failed to read FCT_RX_CTL: %d\n", ret); in smsc75xx_reset()
1419 return ret; in smsc75xx_reset()
1424 ret = smsc75xx_write_reg(dev, FCT_RX_CTL, buf); in smsc75xx_reset()
1425 if (ret < 0) { in smsc75xx_reset()
1426 netdev_warn(dev->net, "Failed to write FCT_RX_CTL: %d\n", ret); in smsc75xx_reset()
1427 return ret; in smsc75xx_reset()
1453 int ret; in smsc75xx_bind() local
1457 ret = usbnet_get_endpoints(dev, intf); in smsc75xx_bind()
1458 if (ret < 0) { in smsc75xx_bind()
1459 netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret); in smsc75xx_bind()
1460 return ret; in smsc75xx_bind()
1486 ret = smsc75xx_wait_ready(dev, 0); in smsc75xx_bind()
1487 if (ret < 0) { in smsc75xx_bind()
1495 ret = smsc75xx_reset(dev); in smsc75xx_bind()
1496 if (ret < 0) { in smsc75xx_bind()
1497 netdev_warn(dev->net, "smsc75xx_reset error %d\n", ret); in smsc75xx_bind()
1514 return ret; in smsc75xx_bind()
1538 int ret; in smsc75xx_write_wuff() local
1540 ret = smsc75xx_write_reg(dev, cfg_base, wuf_cfg); in smsc75xx_write_wuff()
1541 if (ret < 0) { in smsc75xx_write_wuff()
1543 return ret; in smsc75xx_write_wuff()
1546 ret = smsc75xx_write_reg(dev, mask_base, wuf_mask1); in smsc75xx_write_wuff()
1547 if (ret < 0) { in smsc75xx_write_wuff()
1549 return ret; in smsc75xx_write_wuff()
1552 ret = smsc75xx_write_reg(dev, mask_base + 4, 0); in smsc75xx_write_wuff()
1553 if (ret < 0) { in smsc75xx_write_wuff()
1555 return ret; in smsc75xx_write_wuff()
1558 ret = smsc75xx_write_reg(dev, mask_base + 8, 0); in smsc75xx_write_wuff()
1559 if (ret < 0) { in smsc75xx_write_wuff()
1561 return ret; in smsc75xx_write_wuff()
1564 ret = smsc75xx_write_reg(dev, mask_base + 12, 0); in smsc75xx_write_wuff()
1565 if (ret < 0) { in smsc75xx_write_wuff()
1567 return ret; in smsc75xx_write_wuff()
1577 int ret; in smsc75xx_enter_suspend0() local
1579 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_enter_suspend0()
1580 if (ret < 0) { in smsc75xx_enter_suspend0()
1582 return ret; in smsc75xx_enter_suspend0()
1588 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend0()
1589 if (ret < 0) { in smsc75xx_enter_suspend0()
1591 return ret; in smsc75xx_enter_suspend0()
1603 int ret; in smsc75xx_enter_suspend1() local
1605 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_enter_suspend1()
1606 if (ret < 0) { in smsc75xx_enter_suspend1()
1608 return ret; in smsc75xx_enter_suspend1()
1614 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend1()
1615 if (ret < 0) { in smsc75xx_enter_suspend1()
1617 return ret; in smsc75xx_enter_suspend1()
1624 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend1()
1625 if (ret < 0) { in smsc75xx_enter_suspend1()
1627 return ret; in smsc75xx_enter_suspend1()
1639 int ret; in smsc75xx_enter_suspend2() local
1641 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_enter_suspend2()
1642 if (ret < 0) { in smsc75xx_enter_suspend2()
1644 return ret; in smsc75xx_enter_suspend2()
1650 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend2()
1651 if (ret < 0) { in smsc75xx_enter_suspend2()
1653 return ret; in smsc75xx_enter_suspend2()
1665 int ret; in smsc75xx_enter_suspend3() local
1667 ret = smsc75xx_read_reg_nopm(dev, FCT_RX_CTL, &val); in smsc75xx_enter_suspend3()
1668 if (ret < 0) { in smsc75xx_enter_suspend3()
1670 return ret; in smsc75xx_enter_suspend3()
1678 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_enter_suspend3()
1679 if (ret < 0) { in smsc75xx_enter_suspend3()
1681 return ret; in smsc75xx_enter_suspend3()
1687 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend3()
1688 if (ret < 0) { in smsc75xx_enter_suspend3()
1690 return ret; in smsc75xx_enter_suspend3()
1697 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_enter_suspend3()
1698 if (ret < 0) { in smsc75xx_enter_suspend3()
1700 return ret; in smsc75xx_enter_suspend3()
1711 int ret; in smsc75xx_enable_phy_wakeup_interrupts() local
1716 ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC); in smsc75xx_enable_phy_wakeup_interrupts()
1717 if (ret < 0) { in smsc75xx_enable_phy_wakeup_interrupts()
1719 return ret; in smsc75xx_enable_phy_wakeup_interrupts()
1723 ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK); in smsc75xx_enable_phy_wakeup_interrupts()
1724 if (ret < 0) { in smsc75xx_enable_phy_wakeup_interrupts()
1726 return ret; in smsc75xx_enable_phy_wakeup_interrupts()
1729 ret |= mask; in smsc75xx_enable_phy_wakeup_interrupts()
1731 smsc75xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_INT_MASK, ret); in smsc75xx_enable_phy_wakeup_interrupts()
1739 int ret; in smsc75xx_link_ok_nopm() local
1742 ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); in smsc75xx_link_ok_nopm()
1743 if (ret < 0) { in smsc75xx_link_ok_nopm()
1745 return ret; in smsc75xx_link_ok_nopm()
1748 ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); in smsc75xx_link_ok_nopm()
1749 if (ret < 0) { in smsc75xx_link_ok_nopm()
1751 return ret; in smsc75xx_link_ok_nopm()
1754 return !!(ret & BMSR_LSTATUS); in smsc75xx_link_ok_nopm()
1759 int ret; in smsc75xx_autosuspend() local
1772 ret = smsc75xx_enable_phy_wakeup_interrupts(dev, in smsc75xx_autosuspend()
1774 if (ret < 0) { in smsc75xx_autosuspend()
1776 return ret; in smsc75xx_autosuspend()
1784 ret = smsc75xx_enable_phy_wakeup_interrupts(dev, in smsc75xx_autosuspend()
1786 if (ret < 0) { in smsc75xx_autosuspend()
1788 return ret; in smsc75xx_autosuspend()
1800 int ret; in smsc75xx_suspend() local
1802 ret = usbnet_suspend(intf, message); in smsc75xx_suspend()
1803 if (ret < 0) { in smsc75xx_suspend()
1805 return ret; in smsc75xx_suspend()
1817 ret = smsc75xx_autosuspend(dev, link_up); in smsc75xx_suspend()
1830 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
1831 if (ret < 0) { in smsc75xx_suspend()
1838 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
1839 if (ret < 0) { in smsc75xx_suspend()
1844 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_suspend()
1845 if (ret < 0) { in smsc75xx_suspend()
1852 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_suspend()
1853 if (ret < 0) { in smsc75xx_suspend()
1858 ret = smsc75xx_enter_suspend2(dev); in smsc75xx_suspend()
1863 ret = smsc75xx_enable_phy_wakeup_interrupts(dev, in smsc75xx_suspend()
1865 if (ret < 0) { in smsc75xx_suspend()
1878 ret = smsc75xx_mdio_read_nopm(dev->net, mii->phy_id, in smsc75xx_suspend()
1880 if (ret < 0) { in smsc75xx_suspend()
1885 ret |= MODE_CTRL_STS_EDPWRDOWN; in smsc75xx_suspend()
1888 PHY_MODE_CTRL_STS, ret); in smsc75xx_suspend()
1891 ret = smsc75xx_enter_suspend1(dev); in smsc75xx_suspend()
1901 ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0); in smsc75xx_suspend()
1902 if (ret < 0) { in smsc75xx_suspend()
1914 ret = smsc75xx_write_wuff(dev, filter++, val, 0x0007); in smsc75xx_suspend()
1915 if (ret < 0) { in smsc75xx_suspend()
1927 ret = smsc75xx_write_wuff(dev, filter++, val, 0x0003); in smsc75xx_suspend()
1928 if (ret < 0) { in smsc75xx_suspend()
1935 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
1936 if (ret < 0) { in smsc75xx_suspend()
1943 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
1944 if (ret < 0) { in smsc75xx_suspend()
1950 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
1951 if (ret < 0) { in smsc75xx_suspend()
1958 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
1959 if (ret < 0) { in smsc75xx_suspend()
1965 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
1966 if (ret < 0) { in smsc75xx_suspend()
1973 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
1974 if (ret < 0) { in smsc75xx_suspend()
1981 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
1982 if (ret < 0) { in smsc75xx_suspend()
1989 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
1990 if (ret < 0) { in smsc75xx_suspend()
1998 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_suspend()
1999 if (ret < 0) { in smsc75xx_suspend()
2008 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_suspend()
2009 if (ret < 0) { in smsc75xx_suspend()
2017 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
2018 if (ret < 0) { in smsc75xx_suspend()
2026 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
2027 if (ret < 0) { in smsc75xx_suspend()
2035 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
2036 if (ret < 0) { in smsc75xx_suspend()
2043 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
2044 if (ret < 0) { in smsc75xx_suspend()
2052 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_suspend()
2053 if (ret < 0) { in smsc75xx_suspend()
2060 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_suspend()
2061 if (ret < 0) { in smsc75xx_suspend()
2068 ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val); in smsc75xx_suspend()
2069 if (ret < 0) { in smsc75xx_suspend()
2070 netdev_warn(dev->net, "Failed to read MAC_RX: %d\n", ret); in smsc75xx_suspend()
2076 ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val); in smsc75xx_suspend()
2077 if (ret < 0) { in smsc75xx_suspend()
2078 netdev_warn(dev->net, "Failed to write MAC_RX: %d\n", ret); in smsc75xx_suspend()
2084 ret = smsc75xx_enter_suspend0(dev); in smsc75xx_suspend()
2091 if (ret && PMSG_IS_AUTO(message)) in smsc75xx_suspend()
2093 return ret; in smsc75xx_suspend()
2101 int ret; in smsc75xx_resume() local
2111 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); in smsc75xx_resume()
2112 if (ret < 0) { in smsc75xx_resume()
2114 return ret; in smsc75xx_resume()
2120 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); in smsc75xx_resume()
2121 if (ret < 0) { in smsc75xx_resume()
2123 return ret; in smsc75xx_resume()
2127 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_resume()
2128 if (ret < 0) { in smsc75xx_resume()
2130 return ret; in smsc75xx_resume()
2136 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_resume()
2137 if (ret < 0) { in smsc75xx_resume()
2139 return ret; in smsc75xx_resume()
2146 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); in smsc75xx_resume()
2147 if (ret < 0) { in smsc75xx_resume()
2149 return ret; in smsc75xx_resume()
2154 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); in smsc75xx_resume()
2155 if (ret < 0) { in smsc75xx_resume()
2157 return ret; in smsc75xx_resume()
2161 ret = smsc75xx_wait_ready(dev, 1); in smsc75xx_resume()
2162 if (ret < 0) { in smsc75xx_resume()
2164 return ret; in smsc75xx_resume()