--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c 2012-01-26 01:39:32.000000000 +0100 +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c 2012-01-31 20:54:24.798382231 +0100 @@ -1671,12 +1671,75 @@ { struct gelic_card *card; struct net_device *netdev; + u64 lpar_id, laid, hwconfig, eurus_lpar_access, junk; int result; pr_debug("%s: called\n", __func__); udbg_shutdown_ps3gelic(); + /* + * Check for eurus control interface and disable it when it is enabled. + * NB: it must be done before opening the gelic device else it will not work. + */ + + result = lv1_get_logical_partition_id(&lpar_id); + if (result) + goto open_hv_device; + + result = lv1_read_repository_node(1, + 0x0000000073730000ul /* ss */, + 0x6c61696400000000ul /* laid */, + lpar_id, + 0, + &laid, &junk); + if (result || (laid != 0x1070000002000001ul)) + goto open_hv_device; + + result = lv1_read_repository_node(1, + 0x0000000073797300ul /* sys */, + 0x6877000000000000ul /* hw */, + 0x636f6e6669670000ul /* config */, + 0, + &hwconfig, &junk); + if (result || !(hwconfig & 0x40000ul)) + goto open_hv_device; + + result = lv1_read_repository_node(1, + 0x00000000696f7300ul /* ios */, + 0x6e65740000000000ul /* net */, + 0x6575727573000000ul /* eurus */, + 0x6c70617200000000ul /* lpar */, + &eurus_lpar_access, &junk); + if (result) + goto open_hv_device; + + if (!(eurus_lpar_access & (1ul << lpar_id))) { + dev_info(&dev->core, "%s: eurus control interface is already disabled\n", + __func__); + goto open_hv_device; + } else { + dev_info(&dev->core, "%s: eurus control interface is enabled\n", + __func__); + } + + eurus_lpar_access &= ~(1ul << lpar_id); + + result = lv1_write_repository_node(1, + 0x00000000696f7300ul /* ios */, + 0x6e65740000000000ul /* net */, + 0x6575727573000000ul /* eurus */, + 0x6c70617200000000ul /* lpar */, + eurus_lpar_access, junk); + if (result) + dev_info(&dev->core, "%s: eurus control interface could not be disabled\n", + __func__); + else + dev_info(&dev->core, "%s: eurus control interface was disabled\n", + __func__); + +open_hv_device: + result = ps3_open_hv_device(dev); if (result) {