compare_ether_addr was removed in 3.14
[ps3linux_kernel_patches_314.git] / 0160-gelic-disable-eurus-ctrl-iface.patch
blob13fd6bf61d98235b878e12411310387ddc7fbca0
1 --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c 2012-01-26 01:39:32.000000000 +0100
2 +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c 2012-01-31 20:54:24.798382231 +0100
3 @@ -1671,12 +1671,75 @@
5 struct gelic_card *card;
6 struct net_device *netdev;
7 + u64 lpar_id, laid, hwconfig, eurus_lpar_access, junk;
8 int result;
10 pr_debug("%s: called\n", __func__);
12 udbg_shutdown_ps3gelic();
14 + /*
15 + * Check for eurus control interface and disable it when it is enabled.
16 + * NB: it must be done before opening the gelic device else it will not work.
17 + */
19 + result = lv1_get_logical_partition_id(&lpar_id);
20 + if (result)
21 + goto open_hv_device;
23 + result = lv1_read_repository_node(1,
24 + 0x0000000073730000ul /* ss */,
25 + 0x6c61696400000000ul /* laid */,
26 + lpar_id,
27 + 0,
28 + &laid, &junk);
29 + if (result || (laid != 0x1070000002000001ul))
30 + goto open_hv_device;
32 + result = lv1_read_repository_node(1,
33 + 0x0000000073797300ul /* sys */,
34 + 0x6877000000000000ul /* hw */,
35 + 0x636f6e6669670000ul /* config */,
36 + 0,
37 + &hwconfig, &junk);
38 + if (result || !(hwconfig & 0x40000ul))
39 + goto open_hv_device;
41 + result = lv1_read_repository_node(1,
42 + 0x00000000696f7300ul /* ios */,
43 + 0x6e65740000000000ul /* net */,
44 + 0x6575727573000000ul /* eurus */,
45 + 0x6c70617200000000ul /* lpar */,
46 + &eurus_lpar_access, &junk);
47 + if (result)
48 + goto open_hv_device;
50 + if (!(eurus_lpar_access & (1ul << lpar_id))) {
51 + dev_info(&dev->core, "%s: eurus control interface is already disabled\n",
52 + __func__);
53 + goto open_hv_device;
54 + } else {
55 + dev_info(&dev->core, "%s: eurus control interface is enabled\n",
56 + __func__);
57 + }
59 + eurus_lpar_access &= ~(1ul << lpar_id);
61 + result = lv1_write_repository_node(1,
62 + 0x00000000696f7300ul /* ios */,
63 + 0x6e65740000000000ul /* net */,
64 + 0x6575727573000000ul /* eurus */,
65 + 0x6c70617200000000ul /* lpar */,
66 + eurus_lpar_access, junk);
67 + if (result)
68 + dev_info(&dev->core, "%s: eurus control interface could not be disabled\n",
69 + __func__);
70 + else
71 + dev_info(&dev->core, "%s: eurus control interface was disabled\n",
72 + __func__);
74 +open_hv_device:
76 result = ps3_open_hv_device(dev);
78 if (result) {