Commit 9cc05ed4 authored by Sven Van Asbroeck's avatar Sven Van Asbroeck Committed by Greg Kroah-Hartman

staging: fieldbus: move "offline mode" definition to fieldbus core

anybus-s cards use the "offline mode" property to determine if
process memory should be clear, set, or frozen when the card
is offline.

Move this property to the fieldbus core, so that it can become
part of the future fieldbus config interface.
Signed-off-by: default avatarSven Van Asbroeck <TheSven73@gmail.com>
Link: https://lore.kernel.org/r/20190918183552.28959-3-TheSven73@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c1a38e1
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/poll.h> #include <linux/poll.h>
/* move to <linux/fieldbus_dev.h> when taking this out of staging */
#include "../fieldbus_dev.h"
struct anybuss_host; struct anybuss_host;
struct anybuss_client { struct anybuss_client {
...@@ -61,12 +64,6 @@ anybuss_set_drvdata(struct anybuss_client *client, void *data) ...@@ -61,12 +64,6 @@ anybuss_set_drvdata(struct anybuss_client *client, void *data)
int anybuss_set_power(struct anybuss_client *client, bool power_on); int anybuss_set_power(struct anybuss_client *client, bool power_on);
enum anybuss_offl_mode {
AB_OFFL_MODE_CLEAR = 0,
AB_OFFL_MODE_FREEZE,
AB_OFFL_MODE_SET
};
struct anybuss_memcfg { struct anybuss_memcfg {
u16 input_io; u16 input_io;
u16 input_dpram; u16 input_dpram;
...@@ -76,7 +73,7 @@ struct anybuss_memcfg { ...@@ -76,7 +73,7 @@ struct anybuss_memcfg {
u16 output_dpram; u16 output_dpram;
u16 output_total; u16 output_total;
enum anybuss_offl_mode offl_mode; enum fieldbus_dev_offl_mode offl_mode;
}; };
int anybuss_start_init(struct anybuss_client *client, int anybuss_start_init(struct anybuss_client *client,
......
...@@ -96,7 +96,7 @@ static int __profi_enable(struct profi_priv *priv) ...@@ -96,7 +96,7 @@ static int __profi_enable(struct profi_priv *priv)
.output_io = 220, .output_io = 220,
.output_dpram = PROFI_DPRAM_SIZE, .output_dpram = PROFI_DPRAM_SIZE,
.output_total = PROFI_DPRAM_SIZE, .output_total = PROFI_DPRAM_SIZE,
.offl_mode = AB_OFFL_MODE_CLEAR, .offl_mode = FIELDBUS_DEV_OFFL_MODE_CLEAR,
}; };
/* /*
......
...@@ -1022,13 +1022,13 @@ int anybuss_start_init(struct anybuss_client *client, ...@@ -1022,13 +1022,13 @@ int anybuss_start_init(struct anybuss_client *client,
}; };
switch (cfg->offl_mode) { switch (cfg->offl_mode) {
case AB_OFFL_MODE_CLEAR: case FIELDBUS_DEV_OFFL_MODE_CLEAR:
op_mode = 0; op_mode = 0;
break; break;
case AB_OFFL_MODE_FREEZE: case FIELDBUS_DEV_OFFL_MODE_FREEZE:
op_mode = OP_MODE_FBFC; op_mode = OP_MODE_FBFC;
break; break;
case AB_OFFL_MODE_SET: case FIELDBUS_DEV_OFFL_MODE_SET:
op_mode = OP_MODE_FBS; op_mode = OP_MODE_FBS;
break; break;
default: default:
......
...@@ -15,6 +15,12 @@ enum fieldbus_dev_type { ...@@ -15,6 +15,12 @@ enum fieldbus_dev_type {
FIELDBUS_DEV_TYPE_PROFINET, FIELDBUS_DEV_TYPE_PROFINET,
}; };
enum fieldbus_dev_offl_mode {
FIELDBUS_DEV_OFFL_MODE_CLEAR = 0,
FIELDBUS_DEV_OFFL_MODE_FREEZE,
FIELDBUS_DEV_OFFL_MODE_SET
};
/** /**
* struct fieldbus_dev - Fieldbus device * struct fieldbus_dev - Fieldbus device
* @read_area: [DRIVER] function to read the process data area of the * @read_area: [DRIVER] function to read the process data area of the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment