aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
blob: 1970efc08c5868b17e0d85f48f4990c6e87092c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 04dbd87265f6ba4a373b211ba324b437d224fb2d Mon Sep 17 00:00:00 2001
From: John Crispin <blogic@openwrt.org>
Date: Sun, 17 Mar 2013 00:03:31 +0100
Subject: [PATCH 21/38] rt2x00: make wmac loadable via OF on rt288x/305x SoC

This patch ads the match table to allow loading the wmac support from a
devicetree.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/net/wireless/rt2x00/rt2800soc.c
+++ b/drivers/net/wireless/rt2x00/rt2800soc.c
@@ -237,10 +237,17 @@ static int rt2800soc_probe(struct platfo
 	return rt2x00soc_probe(pdev, &rt2800soc_ops);
 }
 
+static const struct of_device_id rt2880_wmac_match[] = {
+	{ .compatible = "ralink,rt2880-wmac" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, rt2880_wmac_match);
+
 static struct platform_driver rt2800soc_driver = {
 	.driver		= {
 		.name		= "rt2800_wmac",
 		.mod_name	= KBUILD_MODNAME,
+		.of_match_table	= rt2880_wmac_match,
 	},
 	.probe		= rt2800soc_probe,
 	.remove		= rt2x00soc_remove,
lude <linux/module.h> #include <linux/mdio-bitbang.h> #include <linux/types.h> @@ -156,7 +157,9 @@ static int mdiobb_read(struct mii_bus *b { struct mdiobb_ctrl *ctrl = bus->priv; int ret, i; + long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { reg = mdiobb_cmd_addr(ctrl, phy, reg); mdiobb_cmd(ctrl, MDIO_C45_READ, phy, reg); @@ -169,13 +172,17 @@ static int mdiobb_read(struct mii_bus *b ret = mdiobb_get_num(ctrl, 16); mdiobb_get_bit(ctrl); + local_irq_restore(flags); + return ret; } static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) { struct mdiobb_ctrl *ctrl = bus->priv; + long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { reg = mdiobb_cmd_addr(ctrl, phy, reg); mdiobb_cmd(ctrl, MDIO_C45_WRITE, phy, reg); @@ -190,6 +197,8 @@ static int mdiobb_write(struct mii_bus * ctrl->ops->set_mdio_dir(ctrl, 0); mdiobb_get_bit(ctrl); + local_irq_restore(flags); + return 0; }