Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d35bbfaa authored by Andrey Shvetsov's avatar Andrey Shvetsov Committed by Greg Kroah-Hartman
Browse files

staging: most: remove dependency on networking-aim



The modules hdm-usb and hdm-dim2 depend on the module aim-network, because
they use the function most_deliver_netinfo that it exports.

To remove this dependency, this patch replaces the call of the function
most_deliver_netinfo with the call of the function that is the parameter
'on_netinfo' of the function request_netinfo.

Signed-off-by: default avatarAndrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78a90020
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -22,7 +22,6 @@
#include <linux/wait.h>
#include <linux/wait.h>
#include <linux/kobject.h>
#include <linux/kobject.h>
#include "mostcore.h"
#include "mostcore.h"
#include "networking.h"


#define MEP_HDR_LEN 8
#define MEP_HDR_LEN 8
#define MDP_HDR_LEN 16
#define MDP_HDR_LEN 16
@@ -176,6 +175,9 @@ static int most_nd_set_mac_address(struct net_device *dev, void *p)
	return 0;
	return 0;
}
}


static void on_netinfo(struct most_interface *iface,
		       unsigned char link_stat, unsigned char *mac_addr);

static int most_nd_open(struct net_device *dev)
static int most_nd_open(struct net_device *dev)
{
{
	struct net_dev_context *nd = dev->ml_priv;
	struct net_dev_context *nd = dev->ml_priv;
@@ -204,7 +206,7 @@ static int most_nd_open(struct net_device *dev)
		netif_dormant_on(dev);
		netif_dormant_on(dev);
	netif_wake_queue(dev);
	netif_wake_queue(dev);
	if (nd->iface->request_netinfo)
	if (nd->iface->request_netinfo)
		nd->iface->request_netinfo(nd->iface, nd->tx.ch_id);
		nd->iface->request_netinfo(nd->iface, nd->tx.ch_id, on_netinfo);
	return 0;
	return 0;
}
}


@@ -216,6 +218,8 @@ static int most_nd_stop(struct net_device *dev)


	BUG_ON(nd->dev != dev);
	BUG_ON(nd->dev != dev);
	netif_stop_queue(dev);
	netif_stop_queue(dev);
	if (nd->iface->request_netinfo)
		nd->iface->request_netinfo(nd->iface, nd->tx.ch_id, NULL);
	most_stop_channel(nd->iface, nd->rx.ch_id, &aim);
	most_stop_channel(nd->iface, nd->rx.ch_id, &aim);
	most_stop_channel(nd->iface, nd->tx.ch_id, &aim);
	most_stop_channel(nd->iface, nd->tx.ch_id, &aim);


@@ -527,12 +531,12 @@ static void __exit most_net_exit(void)
}
}


/**
/**
 * most_deliver_netinfo - callback for HDM to be informed about HW's MAC
 * on_netinfo - callback for HDM to be informed about HW's MAC
 * @param iface - most interface instance
 * @param iface - most interface instance
 * @param link_stat - link status
 * @param link_stat - link status
 * @param mac_addr - MAC address
 * @param mac_addr - MAC address
 */
 */
void most_deliver_netinfo(struct most_interface *iface,
static void on_netinfo(struct most_interface *iface,
		       unsigned char link_stat, unsigned char *mac_addr)
		       unsigned char link_stat, unsigned char *mac_addr)
{
{
	struct net_dev_context *nd;
	struct net_dev_context *nd;
@@ -564,7 +568,6 @@ void most_deliver_netinfo(struct most_interface *iface,
		}
		}
	}
	}
}
}
EXPORT_SYMBOL(most_deliver_netinfo);


module_init(most_net_init);
module_init(most_net_init);
module_exit(most_net_exit);
module_exit(most_net_exit);
+0 −21
Original line number Original line Diff line number Diff line
/*
 * Networking AIM - Networking Application Interface Module for MostCore
 *
 * Copyright (C) 2015, Microchip Technology Germany II GmbH & Co. KG
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * This file is licensed under GPLv2.
 */
#ifndef _NETWORKING_H_
#define _NETWORKING_H_

#include "mostcore.h"

void most_deliver_netinfo(struct most_interface *iface,
			  unsigned char link_stat, unsigned char *mac_addr);

#endif
+0 −1
Original line number Original line Diff line number Diff line
@@ -4,7 +4,6 @@


config HDM_DIM2
config HDM_DIM2
	tristate "DIM2 HDM"
	tristate "DIM2 HDM"
	depends on AIM_NETWORK
	depends on HAS_IOMEM
	depends on HAS_IOMEM


	---help---
	---help---
+14 −4
Original line number Original line Diff line number Diff line
@@ -26,7 +26,6 @@
#include <linux/kthread.h>
#include <linux/kthread.h>


#include <mostcore.h>
#include <mostcore.h>
#include <networking.h>
#include "dim2_hal.h"
#include "dim2_hal.h"
#include "dim2_hdm.h"
#include "dim2_hdm.h"
#include "dim2_errors.h"
#include "dim2_errors.h"
@@ -107,6 +106,8 @@ struct dim2_hdm {
	unsigned char link_state;
	unsigned char link_state;
	int atx_idx;
	int atx_idx;
	struct medialb_bus bus;
	struct medialb_bus bus;
	void (*on_netinfo)(struct most_interface *,
			   unsigned char, unsigned char *);
};
};


#define iface_to_hdm(iface) container_of(iface, struct dim2_hdm, most_iface)
#define iface_to_hdm(iface) container_of(iface, struct dim2_hdm, most_iface)
@@ -287,10 +288,13 @@ static int deliver_netinfo_thread(void *data)


		if (dev->deliver_netinfo) {
		if (dev->deliver_netinfo) {
			dev->deliver_netinfo--;
			dev->deliver_netinfo--;
			most_deliver_netinfo(&dev->most_iface, dev->link_state,
			if (dev->on_netinfo) {
				dev->on_netinfo(&dev->most_iface,
						dev->link_state,
						dev->mac_addrs);
						dev->mac_addrs);
			}
			}
		}
		}
	}


	return 0;
	return 0;
}
}
@@ -654,12 +658,18 @@ static int enqueue(struct most_interface *most_iface, int ch_idx,
 * Send a command to INIC which triggers retrieving of network info by means of
 * Send a command to INIC which triggers retrieving of network info by means of
 * "Message exchange over MDP/MEP". Return 0 on success, negative on failure.
 * "Message exchange over MDP/MEP". Return 0 on success, negative on failure.
 */
 */
static void request_netinfo(struct most_interface *most_iface, int ch_idx)
static void request_netinfo(struct most_interface *most_iface, int ch_idx,
			    void (*on_netinfo)(struct most_interface *,
					       unsigned char, unsigned char *))
{
{
	struct dim2_hdm *dev = iface_to_hdm(most_iface);
	struct dim2_hdm *dev = iface_to_hdm(most_iface);
	struct mbo *mbo;
	struct mbo *mbo;
	u8 *data;
	u8 *data;


	dev->on_netinfo = on_netinfo;
	if (!on_netinfo)
		return;

	if (dev->atx_idx < 0) {
	if (dev->atx_idx < 0) {
		pr_err("Async Tx Not initialized\n");
		pr_err("Async Tx Not initialized\n");
		return;
		return;
+1 −1
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
config HDM_USB
config HDM_USB
	tristate "USB HDM"
	tristate "USB HDM"
	depends on USB && NET
	depends on USB && NET
	select AIM_NETWORK

	---help---
	---help---
	  Say Y here if you want to connect via USB to network tranceiver.
	  Say Y here if you want to connect via USB to network tranceiver.
	  This device driver depends on the networking AIM.
	  This device driver depends on the networking AIM.
Loading