shill: Initialize GSM home provider based on IMSI/SPN and provider DB.

Also, merge the GSM serving operator members (network_id, operator country,
operator name) into a Cellular::Operator structure.

BUG=chromium-os:22572
TEST=unit tests

Change-Id: Ic4e838df62502699534006d876a5ebb632843012
Reviewed-on: https://gerrit.chromium.org/gerrit/11980
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular_capability_gsm.h b/cellular_capability_gsm.h
index dbfe8ca..470730a 100644
--- a/cellular_capability_gsm.h
+++ b/cellular_capability_gsm.h
@@ -10,10 +10,13 @@
 #include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
 #include "shill/accessor_interface.h"
+#include "shill/cellular.h"
 #include "shill/cellular_capability.h"
 #include "shill/modem_gsm_card_proxy_interface.h"
 #include "shill/modem_gsm_network_proxy_interface.h"
 
+struct mobile_provider;
+
 namespace shill {
 
 class CellularCapabilityGSM : public CellularCapability,
@@ -66,6 +69,7 @@
   FRIEND_TEST(CellularCapabilityGSMTest, RegisterOnNetwork);
   FRIEND_TEST(CellularCapabilityGSMTest, Scan);
   FRIEND_TEST(CellularCapabilityGSMTest, SetAccessTechnology);
+  FRIEND_TEST(CellularCapabilityGSMTest, SetHomeProvider);
   FRIEND_TEST(CellularCapabilityGSMTest, UpdateOperatorInfo);
 
   struct SimLockStatus {
@@ -96,6 +100,10 @@
 
   void SetAccessTechnology(uint32 access_technology);
 
+  // Sets the upper level information about the home cellular provider from the
+  // modem's IMSI and SPN.
+  void SetHomeProvider();
+
   // Updates the GSM operator name and country based on a newly obtained network
   // id.
   void UpdateOperatorInfo();
@@ -127,10 +135,9 @@
 
   uint32 registration_state_;
   uint32 access_technology_;
-  std::string network_id_;
-  std::string operator_name_;
-  std::string operator_country_;
+  Cellular::Operator serving_operator_;
   std::string spn_;
+  mobile_provider *home_provider_;
 
   // Properties.
   std::string selected_network_;