aboutsummaryrefslogtreecommitdiff
path: root/crypto/ccmode.c
blob: b1c219929be1264f00e517ef1e3de812f558b114 (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
34
35
36
37
38
39
/*
 * FIPS 200 support.
 *
 * Copyright (c) 2008 Neil Horman <nhorman@tuxdriver.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 */

#include "internal.h"

int cc_mode;
int cc_mode_flag;

EXPORT_SYMBOL_GPL(cc_mode);
EXPORT_SYMBOL_GPL(cc_mode_flag);

int get_cc_mode_state(void)
{
	return cc_mode_flag;
}
EXPORT_SYMBOL_GPL(get_cc_mode_state);

static int cc_mode_enable(char *str)
{
	cc_mode_flag = simple_strtol(str, NULL, 10);
	if ((cc_mode_flag > 0x3f) || (cc_mode_flag < 0)) {
		cc_mode_flag = 0;
	}
	cc_mode = cc_mode_flag & 0x01;
	printk(KERN_INFO "CCMODE: CC mode %s\n",
		cc_mode ? "enabled" : "disabled");
	return 1;
}

__setup("cc_mode=", cc_mode_enable);